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

Fix channel str support #221

Merged
merged 11 commits into from
May 17, 2024
Merged

Fix channel str support #221

merged 11 commits into from
May 17, 2024

Conversation

berombau
Copy link
Contributor

@berombau berombau commented Mar 5, 2024

These test cases did not work:

    def test_plot_can_render_a_single_channel_str_from_image(self, sdata_blobs_str: SpatialData):
        sdata_blobs_str.pl.render_images(elements="blobs_image", channel="c1").pl.show()

    def test_plot_can_render_a_single_channel_str_from_multiscale_image(self, sdata_blobs_str: SpatialData):
        sdata_blobs_str.pl.render_images(elements="blobs_multiscale_image", channel="c1").pl.show()

    def test_plot_can_render_two_channels_str_from_image(self, sdata_blobs_str: SpatialData):
        sdata_blobs_str.pl.render_images(elements="blobs_image", channel=["c1", "c2"]).pl.show()

    def test_plot_can_render_two_channels_str_from_multiscale_image(self, sdata_blobs_str: SpatialData):
        sdata_blobs_str.pl.render_images(elements="blobs_multiscale_image", channel=["c1", "c2"]).pl.show()

I added the tests and the two fixes needed to make them pass. Reported by @thienthu.
The problem with buggy channel string support is usually creating a new Image2DModel with the data but not also the string labels via a c_coords parameter (see src/spatialdata_plot/pl/utils.py:1247).

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.70%. Comparing base (ac062d8) to head (b5f8902).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #221   +/-   ##
=======================================
  Coverage   77.70%   77.70%           
=======================================
  Files          11       11           
  Lines        1722     1722           
=======================================
  Hits         1338     1338           
  Misses        384      384           
Files Coverage Δ
src/spatialdata_plot/pl/render.py 94.61% <100.00%> (ø)
src/spatialdata_plot/pl/utils.py 66.70% <100.00%> (ø)

@timtreis
Copy link
Member

Should now all be fixed, it's failing because the codecov retry limit is reached for now. Will try again in a bit and then merge. Thanks for the work @berombau!

@timtreis timtreis merged commit b51099e into scverse:main May 17, 2024
3 of 5 checks passed
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.

None yet

3 participants