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

Use integer division for new_shape in resize_image #220

Merged
merged 4 commits into from
Sep 8, 2022

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Aug 31, 2022

Fixes issue reported at #219 (comment)

The issue there was that the dask writing used resize_image() which calculated down-sizing using ceil() so the sizes of pyramids levels were 100, 50, 25, 13, 7 instead of 100, 50, 25, 12, 6 as for the non-dask data.

I updated resize_image() to use the same integer division for calculating new_shape as is used in the def __nearest() for non-dask data.

To test:

  • run the sample script on issue above (using ome-zarr-py installed from this branch)
  • check that the pyramid sizes are 100, 50, 25, 12, 6 for both the debug0.zarr (non-dask) and debug1.zarr (dask).
  • The coordinateTransforms should also be the same for both

@codecov
Copy link

codecov bot commented Aug 31, 2022

Codecov Report

Base: 84.26% // Head: 84.46% // Increases project coverage by +0.20% 🎉

Coverage data is based on head (a1fdcf5) compared to base (0c1b1bb).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #220      +/-   ##
==========================================
+ Coverage   84.26%   84.46%   +0.20%     
==========================================
  Files          13       13              
  Lines        1474     1474              
==========================================
+ Hits         1242     1245       +3     
+ Misses        232      229       -3     
Impacted Files Coverage Δ
ome_zarr/scale.py 68.42% <100.00%> (ø)
ome_zarr/reader.py 86.05% <0.00%> (+0.78%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@joshmoore
Copy link
Member

The change & explanation make sense, @will-moore. I'd strongly suggest though that we get the test migrated over from the issue.

@will-moore will-moore mentioned this pull request Sep 7, 2022
@will-moore
Copy link
Member Author

@joshmoore Added more tests, and with #221 they're green!

@sbesson sbesson mentioned this pull request Sep 8, 2022
@joshmoore
Copy link
Member

Thanks, @will-moore.

@joshmoore joshmoore merged commit e3e3968 into ome:master Sep 8, 2022
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