Skip to content

fix: propagate output dtype for fitsbolt normalization and update test assertions#8

Merged
giusgal merged 1 commit intomainfrom
hotfix/propagate-cutana-dtype-to-fitsbolt
Mar 19, 2026
Merged

fix: propagate output dtype for fitsbolt normalization and update test assertions#8
giusgal merged 1 commit intomainfrom
hotfix/propagate-cutana-dtype-to-fitsbolt

Conversation

@giusgal
Copy link
Copy Markdown
Collaborator

@giusgal giusgal commented Mar 17, 2026

Summary

This pull request introduces changes to improve data type handling and normalization methods in the image processing pipeline, as well as updates unit tests to accommodate these enhancements. The main focus is on ensuring that the output data type is determined by configuration and that normalization methods are correctly mapped.

Data type handling improvements:

  • Updated apply_normalisation in cutana/image_processor.py to set the output data type based on config.data_type, defaulting to float32 if the type is unknown. This ensures flexibility and correctness in image normalization output.

Normalization method mapping:

  • Corrected the mapping for the "linear" normalization method in convert_cfg_to_fitsbolt_cfg (cutana/normalisation_parameters.py) to use fitsbolt.NormalisationMethod.LINEAR instead of CONVERSION_ONLY, aligning with expected fitsbolt behavior.

Unit test updates:

  • Modified assertions in test_combine_channels_simple and test_combine_channels_equal_weights (tests/cutana/unit/test_image_processor.py) to accept both np.float32 and np.float64 as valid output types, reflecting the new data type handling logic. [1] [2]

Test Plan:

  • Run CI to ensure all existing processing tests pass with the unified type logic (excluded the ones failing for the new version of pandas)
  • Manually verify that passing types in the config results in the expected enforcement (parity)

@giusgal giusgal requested a review from gomezzz March 17, 2026 12:39
@github-actions
Copy link
Copy Markdown

Overall Coverage

Tests Skipped Failures Errors Time
648 0 💤 3 ❌ 0 🔥 3m 39s ⏱️

@giusgal giusgal merged commit 60fe195 into main Mar 19, 2026
6 of 7 checks passed
@giusgal giusgal deleted the hotfix/propagate-cutana-dtype-to-fitsbolt branch March 19, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants