-
Notifications
You must be signed in to change notification settings - Fork 36
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
Refactor affine transformations and add deprecation utils #550
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #550 +/- ##
==========================================
+ Coverage 73.16% 73.28% +0.12%
==========================================
Files 46 47 +1
Lines 6830 6857 +27
Branches 1308 1308
==========================================
+ Hits 4997 5025 +28
Misses 1284 1284
+ Partials 549 548 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll fix these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Left a single minor comment.
pass | ||
""" | ||
|
||
def decorator(func: F) -> F: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually these type of calls happen once per application lifecycle. If we display warning every time the function is called, it could be annoying. Perhaps move the warning outside of the wrapper
but keep it still inside of the decorator
? Since each function gets decorated only once (not sure how this will if the file is imported multiple times), a single log should be printed.
This pull request introduces several changes to the
kwave
utilities, focusing on handling deprecation warnings, improving affine transformations, and updating rotation matrix calculations. The most important changes include adding a deprecation utility, replacingget_affine_matrix
withmake_affine
, and usingscipy.spatial.transform.Rotation
for rotation matrices.Deprecation Handling:
deprecated
decorator inkwave/utils/deprecation.py
to mark functions as deprecated and provide warnings.Affine Transformations:
get_affine_matrix
withmake_affine
inkwave/utils/kwave_array.py
andkwave/utils/math.py
to create affine transformation matrices. [1] [2]get_affine_matrix
in favor ofmake_affine
.Rotation Matrices:
scipy.spatial.transform.Rotation
inkwave/utils/mapgen.py
andkwave/utils/math.py
. [1] [2] [3]Code Refactor:
kwave/utils/kwave_array.py
andkwave/utils/mapgen.py
. [1] [2]