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

Cache reads in RasterDataset #85

Merged
merged 1 commit into from Aug 16, 2021
Merged

Cache reads in RasterDataset #85

merged 1 commit into from Aug 16, 2021

Conversation

adamjstewart
Copy link
Collaborator

See #81 for design details.

This only covers RasterDataset, not VectorDataset. There's still a lot more that we could potentially do, but this is a good start.

I can't really test this without #84.

@adamjstewart adamjstewart added the datasets Geospatial or benchmark datasets label Aug 14, 2021
tensor: Tensor = torch.tensor(dest) # type: ignore[attr-defined]
return tensor

@functools.lru_cache(maxsize=128)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcode cache size of 128 doesn't seem wise?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache size doesn't actually matter here. We're caching file handles, not images. Each image is ~0.5 GB, but each file handle is tiny. GDAL has its own cache size that controls how large the cache actually is. Users can change this if they need to.

@adamjstewart adamjstewart merged commit eaf6e28 into main Aug 16, 2021
@adamjstewart adamjstewart deleted the features/cache-raster branch August 16, 2021 21:25
@adamjstewart adamjstewart added this to the 0.1.0 milestone Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants