Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 asbounds_equal
and usesnp.close
withrtol=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 ofdiameter * 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
mypy
returns no errorpytest --runslow
succeedsmake clean && make html
indocs/
)black
andisort
)