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

Fixes on dataloaders #439

Merged
merged 10 commits into from
Mar 20, 2024
Merged

Fixes on dataloaders #439

merged 10 commits into from
Mar 20, 2024

Conversation

LucaMarconato
Copy link
Member

@LucaMarconato LucaMarconato commented Jan 23, 2024

This PR improves the ImageTilesDataset class in the following ways.

  • General minor cleanup, validation of the arguments and improvement of the docstring.
  • Now the regions to derive the tiles from can also be labels and multiscale lables; before only polygons, multipolygons and circles were supported. Points are not supported.
  • Now the dataset works also with multiscale images, both if rasterize is True or False. The output is always a single scale image.
  • The implementation is now simplified thanks to the use of to_circles() API; in particular in _get_tile_coords() there is no need anymore to perform affine matrix multiplications manually.
  • I removed the logic around polygon.length. Before if the regions were polygons or multipolygons, the perimeter of these polygon would have been used as the tile width/height. This contrasted with the usage of the diameter for circles. Now any region element is transformed to circles element using to_circles() and the tile sizes are the diameters of these circles.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

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

Project coverage is 92.63%. Comparing base (421c315) to head (a119850).
Report is 1 commits behind head on main.

❗ Current head a119850 differs from pull request most recent head e7aef86. Consider uploading reports for the commit e7aef86 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #439      +/-   ##
==========================================
+ Coverage   92.58%   92.63%   +0.05%     
==========================================
  Files          43       43              
  Lines        5867     5894      +27     
==========================================
+ Hits         5432     5460      +28     
+ Misses        435      434       -1     
Files Coverage Δ
src/spatialdata/datasets.py 100.00% <100.00%> (ø)
src/spatialdata/dataloader/datasets.py 90.86% <92.40%> (+2.15%) ⬆️

... and 3 files with indirect coverage changes

@LucaMarconato LucaMarconato marked this pull request as ready for review March 20, 2024 01:06
@LucaMarconato LucaMarconato merged commit 778f508 into main Mar 20, 2024
7 checks passed
@LucaMarconato LucaMarconato deleted the fix/tiles branch March 20, 2024 01:31
@LucaMarconato
Copy link
Member Author

CC @giovp

@LucaMarconato
Copy link
Member Author

Further fixes are introduced with https://github.com/scverse/spatialdata/pull/495/files.

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.

1 participant