Skip to content

Record: make field ordering deterministic, add test - #199

Merged
inducer merged 10 commits into
inducer:mainfrom
matthiasdiener:record-dict
Mar 20, 2024
Merged

Record: make field ordering deterministic, add test#199
inducer merged 10 commits into
inducer:mainfrom
matthiasdiener:record-dict

Conversation

@matthiasdiener

@matthiasdienermatthiasdiener commented Feb 27, 2024

Copy link
Copy Markdown
Contributor

This is a proof-of-concept and is ready for a first look @inducer. I'm not sure if there is a better way to do this.

Please squash

@matthiasdienermatthiasdiener changed the title Record: make field ordering deterministicRecord: make field ordering deterministic, add testFeb 27, 2024
@inducer

Copy link
Copy Markdown
Owner
  • This seems OK, although it is a compatibility break, which I'm not loving.
  • We should just deprecate the thing for removal in 2025. I.e. have it spew warnings, and remove it from the docs. (in favor of dataclasses, which do the same thing, but more competently)

@matthiasdiener

Copy link
Copy Markdown
ContributorAuthor
  • This seems OK, although it is a compatibility break, which I'm not loving.

Is there a use case that breaks with this change? My goal was to remain compatible with the previous set-based implementation (which is the reason for the conversion from set to dict in __init__).

  • We should just deprecate the thing for removal in 2025. I.e. have it spew warnings, and remove it from the docs. (in favor of dataclasses, which do the same thing, but more competently)

What do you think of c32e6d0?

@matthiasdiener
matthiasdiener marked this pull request as ready for review February 27, 2024 21:50
@matthiasdiener

matthiasdiener commented Feb 27, 2024

Copy link
Copy Markdown
ContributorAuthor

Setting this as ready for review. In addition to the pytato/loopy tests, mirgecom also seems to run fine with it.

Comment threadpytools/__init__.py
Comment threadpytools/__init__.py Outdated
Comment threadpytools/__init__.py Outdated
@matthiasdiener
matthiasdienerforce-pushed the record-dict branch 2 times, most recently from 5905e52 to e0e04b0CompareMarch 15, 2024 21:01
Comment threadpytools/__init__.py
@inducer
inducerforce-pushed the record-dict branch 3 times, most recently from 12fd003 to 9cec923CompareMarch 20, 2024 18:18
@inducer
inducer merged commit 0b4604c into inducer:mainMar 20, 2024
inducer added a commit that referenced this pull request Mar 20, 2024
@inducer

Copy link
Copy Markdown
Owner

I'll be honest, I underestimated the compatibility impact of this. I've just pushed a revert.

@inducer

Copy link
Copy Markdown
Owner

inducer/loopy#785 gets rid of a good bunch more Records in Loopy, which may make this more plausible.

@inducer

Copy link
Copy Markdown
Owner

@matthiasdiener Could you please re-make a PR for this?

@matthiasdiener

Copy link
Copy Markdown
ContributorAuthor

Sure, no problem! Sorry for the confusion. Is there a particular error that came up with this?

@inducer

Copy link
Copy Markdown
Owner

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@matthiasdiener@inducer