Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Implement RangeVarConstraint #3261

Merged
merged 11 commits into from
Oct 11, 2024
Merged

core: Implement RangeVarConstraint #3261

merged 11 commits into from
Oct 11, 2024

Conversation

alexarice
Copy link
Collaborator

@alexarice alexarice commented Oct 8, 2024

Continuation of #2704

Co-authored-by: Emilien Bauer papychacal@gmail.com

@alexarice alexarice added the core xDSL core (ir, textual format, ...) label Oct 8, 2024
@alexarice alexarice self-assigned this Oct 8, 2024
@alexarice alexarice marked this pull request as draft October 8, 2024 14:44
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.01%. Comparing base (adbbb86) to head (67298d7).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3261      +/-   ##
==========================================
+ Coverage   89.99%   90.01%   +0.01%     
==========================================
  Files         445      445              
  Lines       55749    55848      +99     
  Branches     5367     5371       +4     
==========================================
+ Hits        50173    50271      +98     
- Misses       4166     4169       +3     
+ Partials     1410     1408       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alexarice alexarice marked this pull request as ready for review October 8, 2024 15:47
@alexarice
Copy link
Collaborator Author

Would be nice to get the commit attribution correct as this is still mainly @PapyChacal 's work, I just made pyright happy and put some match statements on the tests

@superlopuh
Copy link
Member

I edited the description, which should propagate authorship when the PR is merged

Copy link
Member

@superlopuh superlopuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to have @math-fehr and @PapyChacal's ticks before merging

Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment on lines 23 to 24
ranges: dict[str, tuple[Attribute, ...]] = field(default_factory=dict)
"""The assignment of constraint range variables."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we somehow check somewhere that the variable and range variables have different names?
Otherwise I think the can_infer and infer funcitons might be incorrect if someone have twice the same name for range variable and variable.

If it's too annoying to check, jsut make an issue for it, as I don't think it's actually gonna happen in practice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've put this in as the last commit, can revert it if it is deemed too messy

@alexarice
Copy link
Collaborator Author

@superlopuh @math-fehr any thoughts on whether to keep the last commit?

@superlopuh
Copy link
Member

IDK, I'd rather add helpers to add and get variables on the original objects, and keep all the logic to one class, from an architecture point of view there's some dubious coupling going on there, it would nice for the unicity logic to be encapsulated.

@alexarice
Copy link
Collaborator Author

Sure, I'll do that

@alexarice alexarice force-pushed the alexarice/range-variable branch from d4323c1 to 67298d7 Compare October 11, 2024 13:17
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@alexarice
Copy link
Collaborator Author

I removed the last commit, implemented it as @superlopuh suggested. In the process of this I rebased past the pyright changes and now had to fix some other stuff. I think this is because I generalised AnyOf at some point in this commit mistakenly. I can try to revert these changes if wanted.

Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me that looks good!

@alexarice alexarice merged commit f2ba5f7 into main Oct 11, 2024
14 checks passed
@alexarice alexarice deleted the alexarice/range-variable branch October 11, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants