k-wave-python icon indicating copy to clipboard operation
k-wave-python copied to clipboard

Refactor affine transfomrations and add deprecation utils

Open waltsims opened this issue 11 months ago • 1 comments

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, replacing get_affine_matrix with make_affine, and using scipy.spatial.transform.Rotation for rotation matrices.

Deprecation Handling:

  • Added a deprecated decorator in kwave/utils/deprecation.py to mark functions as deprecated and provide warnings.

Affine Transformations:

  • Replaced get_affine_matrix with make_affine in kwave/utils/kwave_array.py and kwave/utils/math.py to create affine transformation matrices. [1] [2]
  • Deprecated get_affine_matrix in favor of make_affine.

Rotation Matrices:

  • Updated rotation matrix calculations to use scipy.spatial.transform.Rotation in kwave/utils/mapgen.py and kwave/utils/math.py. [1] [2] [3]

Code Refactor:

  • Removed unused imports and reorganized imports in kwave/utils/kwave_array.py and kwave/utils/mapgen.py. [1] [2]

waltsims avatar Feb 09 '25 04:02 waltsims

Codecov Report

Attention: Patch coverage is 94.33962% with 6 lines in your changes missing coverage. Please review.

Project coverage is 73.26%. Comparing base (b78cd2a) to head (7bb4add). Report is 29 commits behind head on master.

Files with missing lines Patch % Lines
kwave/utils/math.py 94.00% 3 Missing and 3 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #550      +/-   ##
==========================================
+ Coverage   73.16%   73.26%   +0.09%     
==========================================
  Files          46       46              
  Lines        6830     6848      +18     
  Branches     1308     1307       -1     
==========================================
+ Hits         4997     5017      +20     
+ Misses       1284     1283       -1     
+ Partials      549      548       -1     
Flag Coverage Δ
3.10 73.26% <94.33%> (+0.09%) :arrow_up:
3.11 73.26% <94.33%> (+0.09%) :arrow_up:
3.12 73.26% <94.33%> (+0.09%) :arrow_up:
3.13 73.26% <94.33%> (+0.09%) :arrow_up:
macos-latest 73.23% <94.33%> (+0.09%) :arrow_up:
ubuntu-latest 73.23% <94.33%> (+0.09%) :arrow_up:
windows-latest 73.24% <94.33%> (+0.09%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Feb 09 '25 16:02 codecov[bot]