Skip to content

Fixes on dataloaders - #439

Merged
LucaMarconato merged 10 commits into
mainfrom
fix/tiles
Mar 20, 2024
Merged

Fixes on dataloaders#439
LucaMarconato merged 10 commits into
mainfrom
fix/tiles

Conversation

@LucaMarconato

@LucaMarconatoLucaMarconato commented Jan 23, 2024

Copy link
Copy Markdown
Member

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.

@LucaMarconatoLucaMarconato mentioned this pull request Feb 13, 2024
@codecov

codecovBot commented Mar 20, 2024

Copy link
Copy Markdown

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 
FilesCoverage Δ
src/spatialdata/datasets.py100.00% <100.00%> (ø)
src/spatialdata/dataloader/datasets.py90.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

Copy link
Copy Markdown
MemberAuthor

CC @giovp

@LucaMarconato

Copy link
Copy Markdown
MemberAuthor

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

Sign up for freeto 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

@LucaMarconato