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

add test for path length #362

Closed
wants to merge 1 commit into from
Closed

Conversation

R4chel
Copy link
Contributor

@R4chel R4chel commented Mar 2, 2023

Description

Add a utility function to the test suite to test if the length of path drawn is equal to the expected length.

This was written to help show odd behavior when the radius was negative #352

In this PR the function length_equal is added and then used in existing tests where the length is known.

length_equal is written in the style of existing testing utility functions such as bounds_equal and uses np.close with rtol=1e-3. This means the paths will be considered to be the same length if the difference is within 0.001. This made sense to also use for this case because the calculated length is based on drawing a perfect circle with a circumference of diameter * pi, which is not exactly what is being drawn and even if it was there would be some error inherent from comparing floats and we would want some tolerance.

Checklist

  • feature/fix implemented
  • mypy returns no error
  • tests added/updated and pytest --runslow succeeds
  • documentation added/updated and building with no error (make clean && make html in docs/)
  • examples added/updated
  • code formatting ok (black and isort)

@R4chel R4chel force-pushed the assert-path-length branch from 977f352 to ded3a6e Compare March 2, 2023 18:16
@R4chel R4chel closed this Mar 2, 2023
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.

1 participant