Skip to content

save voxelsize as explictit parameters rather than np array#407

Merged
jo-mueller merged 10 commits into
campaslab:mainfrom
jo-mueller:tidy-parameter-save
May 27, 2025
Merged

save voxelsize as explictit parameters rather than np array#407
jo-mueller merged 10 commits into
campaslab:mainfrom
jo-mueller:tidy-parameter-save

Conversation

@jo-mueller

Copy link
Copy Markdown
Member

This pull request refactors how voxel size parameters are handled in the reconstruction toolbox and removes custom YAML serialization logic for numpy arrays. The changes improve code clarity and simplify the import/export process by eliminating unnecessary complexity.

Refactoring voxel size handling:

  • In _export_settings (src/napari_stress/_reconstruction/toolbox.py): Replaced the voxelsize dictionary key, which previously stored a numpy array, with individual keys (voxelsize_z, voxelsize_y, voxelsize_x) for better readability and maintainability.
  • In _import_settings (src/napari_stress/_reconstruction/toolbox.py): Updated the code to retrieve individual voxel size values (voxelsize_z, voxelsize_y, voxelsize_x) instead of indexing into a numpy array, aligning with the new export format.

Simplifying YAML serialization:

  • In import_settings (src/napari_stress/_utils/import_export_settings.py): Removed the custom YAML constructor for numpy arrays, as it is no longer needed due to the refactored voxel size handling.
  • In export_settings (src/napari_stress/_utils/import_export_settings.py): Removed the custom YAML representer for numpy arrays, simplifying the export logic.

@jo-mueller jo-mueller added the enhancement New feature or request label May 26, 2025
@codecov

codecov Bot commented May 26, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 76.92308% with 18 lines in your changes missing coverage. Please review.

Project coverage is 83.72%. Comparing base (9ae88be) to head (a2cff8b).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
src/napari_stress/_measurements/toolbox.py 71.42% 2 Missing ⚠️
src/napari_stress/_reconstruction/toolbox.py 60.00% 2 Missing ⚠️
src/napari_stress/_approximation/expansion.py 66.66% 1 Missing ⚠️
src/napari_stress/_approximation/expansion_base.py 66.66% 1 Missing ⚠️
...c/napari_stress/_approximation/expansion_napari.py 66.66% 1 Missing ⚠️
src/napari_stress/_approximation/fit_ellipsoid.py 66.66% 1 Missing ⚠️
src/napari_stress/_measurements/curvature.py 66.66% 1 Missing ⚠️
src/napari_stress/_measurements/geodesics.py 66.66% 1 Missing ⚠️
src/napari_stress/_measurements/intensity.py 66.66% 1 Missing ⚠️
src/napari_stress/_measurements/stresses.py 66.66% 1 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
- Coverage   85.80%   83.72%   -2.09%     
==========================================
  Files          56       56              
  Lines        9929     9660     -269     
==========================================
- Hits         8520     8088     -432     
- Misses       1409     1572     +163     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@jo-mueller jo-mueller merged commit 60a5d0e into campaslab:main May 27, 2025
13 of 14 checks passed
@jo-mueller jo-mueller deleted the tidy-parameter-save branch May 27, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant