-
Notifications
You must be signed in to change notification settings - Fork 28
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
Moral degenerates #20
Conversation
Add optional precision argument to predicates. Also use the system's float_info.precision to detect degeneracy.
Also add a higher precision test of almost_equals.
@perrygeo I'm offering this one as an alternative to #19. This PR doesn't touch much of the implementation except to turn predicate properties that were using the global epsilon into methods that take a precision keyword argument (defaulting to 1.0e-5). It also removes any precision from the degeneracy test, now it's just I'm putting this on a 2.0 milestone because it's an API breaker. |
This looks great. Def. a breaking change since many properties become methods. But I think it's a good move. I wonder if we could apply the degeneracy test of Also a left field, totally wacky idea to maintain backwards compatibility. I wonder if there is a way to create a hybrid property-method such that |
Bonus 100% coverage :) |
FWIW, I did find a way to make properties callable so that we could keep using them as properties or optionally as methods. Via @kezabelle : https://gist.github.com/kezabelle/43f45edefdcd1377b70eb171d4cffd1e#file-property_method-py Not sure if this is something you'd be interested in implementing for the sake of backwards compat? But it proves that it can be done. Leaving it here just in case. |
@perrygeo I like it! |
Can be assigned as an instance attribute if user needs a non-default value.
Conflicts: affine/__init__.py
In the end, I think it's best for precision to be a Affine instance attribute and not add a complex descriptor. |
Please ignore the noise caused by my fumbling fingers. |
Closes #18