Closed ternaus closed 1 month ago
This pull request introduces two new decorators for image processing functions: float32_io
and uint8_io
. These decorators ensure consistent input/output data types for image processing functions. The PR also includes updates to existing functions and tests to support these new decorators.
Change | Details | Files |
---|---|---|
Added new decorators for image processing functions |
|
albucore/functions.py |
Added tests for new decorators and updated functions |
|
tests/test_utils.py tests/test_to_from_float.py |
Refactored existing decorators |
|
albucore/utils.py albucore/decorators.py |
Updated dependencies |
|
.pre-commit-config.yaml |
Attention: Patch coverage is 96.42857%
with 4 lines
in your changes missing coverage. Please review.
Please upload report for BASE (
main@5f9611f
). Learn more about missing BASE report.
Files with missing lines | Patch % | Lines |
---|---|---|
albucore/decorators.py | 92.85% | 2 Missing :warning: |
albucore/functions.py | 93.10% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by Sourcery
Add decorators to ensure consistent data types for image processing functions and optimize data type handling in conversion functions. Update tests to cover new decorators and improve pre-commit configuration.
New Features:
float32_io
anduint8_io
decorators to ensure consistent input/output data types for image processing functions, converting images to float32 or uint8 as needed.Enhancements:
to_float
andfrom_float
functions to handle float32 and float64 data types more efficiently by avoiding unnecessary conversions.Build:
Tests:
float32_io
anduint8_io
decorators to verify that they correctly handle data type conversions and preserve the original data type.to_float
returns the same object for float32 inputs and thatto_float
andfrom_float
functions maintain data integrity through round-trip conversions.Chores:
contiguous
andpreserve_channel_dim
decorators to a newdecorators.py
file for better organization.