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

feat[frontend]: add angle validator to specify expected angle in radians #2163

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

groberts-flex
Copy link
Contributor

Provides a clearer validation message that the expected units for the sidewall_angle field are in radians to explain why the range is between +/- pi/2.

Copy link

Copy link
Collaborator

@yaugenst-flex yaugenst-flex left a comment

Choose a reason for hiding this comment

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

Thanks @groberts-flex, looks great! Don't forget the changelog though, even if it's a small change.

upper_bound = np.pi / 2
if (value <= lower_bound) or (value >= upper_bound):
raise ValidationError(
f"sidewall angle ({value}) must be between {lower_bound} and {upper_bound} rad"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Capitalization and punctuation :)

Other than that, should we consider just writing between -π/2 and π/2 rad maybe? Don't think this bound is going to change, and the message would be even clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch! And yes, I like that idea and updated the string!

@groberts-flex groberts-flex force-pushed the groberts-flex/angle_validator branch 2 times, most recently from eda6972 to 7861fdb Compare January 15, 2025 16:16
@yaugenst-flex yaugenst-flex added the 2.8 will go into version 2.8.* label Jan 15, 2025
@groberts-flex groberts-flex force-pushed the groberts-flex/angle_validator branch from 7861fdb to 11fe1e5 Compare January 15, 2025 16:39
@groberts-flex groberts-flex force-pushed the groberts-flex/angle_validator branch from 11fe1e5 to cc7dc6d Compare January 16, 2025 16:51
@yaugenst-flex yaugenst-flex merged commit 91626bb into pre/2.8 Jan 16, 2025
15 checks passed
@yaugenst-flex yaugenst-flex deleted the groberts-flex/angle_validator branch January 16, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.8 will go into version 2.8.*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants