Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[python] Fix retrieval of named levels from a MultiscaleImage #3119

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

aaronwolen
Copy link
Member

@aaronwolen aaronwolen commented Oct 3, 2024

Before this PR:

scene.img["tissue"].get_transform_to_level(0)
## <somacore.coordinates.ScaleTransform at 0x17701b390>

scene.img["tissue"].get_transform_to_level("hires")
## KeyError                                  Traceback (most recent call last)
## Cell In[325], line 1
## ----> 1 scene.img[image_name].get_transform_to_level("hires")
## 
## File ~/Library/CloudStorage/Dropbox-TileDB/Aaron Wolen/customers/czi/TileDB-SOMA2/apis/python/src/tiledbsoma/_multiscale_image.py:551, in MultiscaleImage.get_transform_to_level(self, level)
##     549             level_props = val
##     550         else:
## --> 551             raise KeyError("No level with name '{level}'")
##     552 else:
##     553     level_props = self._levels[level]
## 
## KeyError: "No level with name '{level}'"

With this PR:

scene.img["tissue"].get_transform_to_level(0)
## <somacore.coordinates.ScaleTransform object at 0x16f7667d0>

scene.img["tissue"].get_transform_to_level("hires")
## <somacore.coordinates.ScaleTransform object at 0x16f8189d0>

@johnkerl johnkerl changed the title Fix retrieval of named levels from a MultiscaleImage [python] Fix retrieval of named levels from a MultiscaleImage Oct 3, 2024
@aaronwolen aaronwolen merged commit 45a77b7 into main Oct 3, 2024
5 of 9 checks passed
@aaronwolen aaronwolen deleted the aaronwolen/fix-named-level-retrieval branch October 3, 2024 17:49
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

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

Project coverage is 86.49%. Comparing base (c2a34e5) to head (a42737f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3119       +/-   ##
===========================================
+ Coverage   63.31%   86.49%   +23.18%     
===========================================
  Files         113       47       -66     
  Lines       14331     4924     -9407     
  Branches      855        0      -855     
===========================================
- Hits         9073     4259     -4814     
+ Misses       5050      665     -4385     
+ Partials      208        0      -208     
Flag Coverage Δ
libtiledbsoma ?
python 86.49% <0.00%> (-0.08%) ⬇️

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

Components Coverage Δ
python_api 86.49% <0.00%> (-0.08%) ⬇️
libtiledbsoma ∅ <ø> (∅)

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