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

bug: Fix cse for FloatData #3396

Merged
merged 4 commits into from
Nov 4, 2024
Merged

bug: Fix cse for FloatData #3396

merged 4 commits into from
Nov 4, 2024

Conversation

n-io
Copy link
Collaborator

@n-io n-io commented Nov 4, 2024

FloatData recently received an __eq__ method to handle nan inequalities. Because of this change, it also needs to provide a __hash__ method.

@n-io n-io added the bug Something isn't working label Nov 4, 2024
@n-io n-io self-assigned this Nov 4, 2024
@n-io n-io changed the title bug: Fix cse for float data bug: Fix cse for FloatData Nov 4, 2024
@n-io n-io requested a review from alexarice November 4, 2024 15:46
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.14%. Comparing base (87e1a46) to head (9456604).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3396      +/-   ##
==========================================
+ Coverage   90.13%   90.14%   +0.01%     
==========================================
  Files         452      452              
  Lines       57157    57159       +2     
  Branches     5498     5498              
==========================================
+ Hits        51519    51528       +9     
+ Misses       4180     4175       -5     
+ Partials     1458     1456       -2     

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

@@ -636,6 +636,9 @@ def __eq__(self, other: Any):
math.isnan(self.data) and math.isnan(other.data) or self.data == other.data
)

def __hash__(self):
return super().__hash__()
Copy link
Member

Choose a reason for hiding this comment

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

Does this work? Would cut out the middle man

Suggested change
return super().__hash__()
return hash(self.data)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does indeed

Co-authored-by: Sasha Lopoukhine <[email protected]>
@n-io n-io merged commit 130ed7e into main Nov 4, 2024
15 checks passed
@n-io n-io deleted the nicolai/cse-fix branch November 4, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants