Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

change channel names #786

Merged
merged 15 commits into from
Nov 22, 2024
Merged

change channel names #786

merged 15 commits into from
Nov 22, 2024

Conversation

melonora
Copy link
Collaborator

@melonora melonora commented Nov 13, 2024

Closes #750

This PR allows for either changing the channel_names by means of a static method on a image SpatialElement or in case of an element in the Spatialdata object a method taking as parameter the element name.

Also when channel names get written the metadata on disk is updated.

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 89.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 91.80%. Comparing base (62e4699) to head (d8cd38e).
Report is 72 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata/models/_utils.py 83.33% 3 Missing ⚠️
src/spatialdata/_core/spatialdata.py 91.66% 2 Missing ⚠️
src/spatialdata/_io/_utils.py 92.30% 1 Missing ⚠️
src/spatialdata/_utils.py 88.88% 1 Missing ⚠️
src/spatialdata/transformations/operations.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #786      +/-   ##
==========================================
- Coverage   91.84%   91.80%   -0.05%     
==========================================
  Files          45       45              
  Lines        6893     6954      +61     
==========================================
+ Hits         6331     6384      +53     
- Misses        562      570       +8     
Files with missing lines Coverage Δ
src/spatialdata/_core/operations/map.py 97.77% <100.00%> (ø)
src/spatialdata/_core/operations/transform.py 90.82% <100.00%> (ø)
src/spatialdata/_io/io_raster.py 96.06% <100.00%> (ø)
src/spatialdata/models/__init__.py 100.00% <ø> (ø)
src/spatialdata/models/models.py 87.78% <100.00%> (+0.02%) ⬆️
src/spatialdata/_io/_utils.py 87.22% <92.30%> (+0.39%) ⬆️
src/spatialdata/_utils.py 87.41% <88.88%> (+0.09%) ⬆️
src/spatialdata/transformations/operations.py 88.40% <50.00%> (-0.43%) ⬇️
src/spatialdata/_core/spatialdata.py 90.88% <91.66%> (+<0.01%) ⬆️
src/spatialdata/models/_utils.py 90.41% <83.33%> (-1.03%) ⬇️

@melonora melonora marked this pull request as ready for review November 13, 2024 22:50
@LucaMarconato
Copy link
Member

LucaMarconato commented Nov 21, 2024

Looks great! Three further minor comments:

  • after renaming get_channels() to get_channel_names(), we need to:
    • update the docs
    • call automatically get_channel_names() from get_channels() and give a deprecation warning
  • we need to call write_channel_names() from write_metadata()
  • we need to update the test for write_metadata() to consider the channel names

@melonora melonora merged commit 94f0a31 into scverse:main Nov 22, 2024
7 of 8 checks passed
@melonora melonora deleted the set_channels branch November 22, 2024 05:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improving ergonomics for channel names handling
2 participants