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

Use a single clamper for floats #4207

Merged
merged 5 commits into from
Dec 21, 2024
Merged

Conversation

tybug
Copy link
Member

@tybug tybug commented Dec 21, 2024

This pull changes the float clamper to directly incorporate float kwargs. While I think this approach is cleaner, I'm really doing it because it is easier to reuse the single clamper for future typed choice sequence work I have lined up.

Also removes a rule removed in new ruff versions to silence a warning, but we'll see if CI likes that 😄

@tybug tybug requested a review from Zac-HD as a code owner December 21, 2024 00:25
@tybug tybug force-pushed the float-clamper branch 2 times, most recently from b835247 to 843d540 Compare December 21, 2024 02:00
}


def make_integer_kw(min_value, max_value, *, weights=None, shrink_towards=0):
Copy link
Member Author

Choose a reason for hiding this comment

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

Planned follow-up pull: use these convenience methods in tests! The space save of not specifying weights/shrink_towards/smallest_mag unless we care that it's non-default should be pretty solid.

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.

nice!

@tybug tybug merged commit cd7dd9c into HypothesisWorks:master Dec 21, 2024
49 checks passed
@tybug tybug deleted the float-clamper branch December 21, 2024 16:50
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.

2 participants