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

Extend redistribute_integer_pairs to floats #4222

Merged
merged 6 commits into from
Jan 8, 2025

Conversation

tybug
Copy link
Member

@tybug tybug commented Dec 31, 2024

also addresses a TODO in minimize_duplicated_nodes.

@tybug tybug requested a review from Zac-HD as a code owner December 31, 2024 06:11
@tybug tybug force-pushed the redistribute-numeric branch from e08cf99 to ef0205f Compare December 31, 2024 20:44
Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

Looks good overall, but see note about precision - I'd appreciate some more tests for nasty floating-point cases (small, large, infs, nans...) to check that when we shrink it's always to something smaller, which is true for integers but maybe not for floats.

@@ -1381,15 +1391,20 @@ def redistribute_integer_pairs(self, chooser):
and node1.index < node.index <= node1.index + 4,
)

m = node1.value
n = node2.value
m: Union[int, float] = node1.value
Copy link
Member Author

Choose a reason for hiding this comment

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

preempting a comment: distinguishing these two does actually matter for mypyc.

@Zac-HD Zac-HD enabled auto-merge January 8, 2025 05:48
@Zac-HD Zac-HD merged commit d4ed093 into HypothesisWorks:master Jan 8, 2025
47 checks passed
@tybug tybug deleted the redistribute-numeric branch January 13, 2025 07:55
Sign up for free to 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.

3 participants