forked from scipy/scipy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add ability to silence Gimbal Lock warnings for rotations
While it is possible to silence warnings with `catch_warnings()` context manager and a filter the approach has a few drawbacks: 1) The warnings are still emitted, which can have a perf impact 2) Using catch_warnings hits this bug `python/cpython#73858` that may reset a bunch of other warnings. Thus we change the core of the cython functions to return an extra boolean when a gimbals lock was detected and emit the warnings only once. This does mean that the gimbals warning is emitted only once when computed on an array. I guess this might have a perf impact as we emit the warning only once. We could also refactor to store an int and say how many gimbal lock were detected. (redo of scipy#19338) some review Update scipy/spatial/transform/_rotation.pyx
- Loading branch information
Showing
2 changed files
with
110 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters