Change Resampler caching options to Resampler creation
@pnuu is already working on this.
Since May 20, 2021.
- Dominant language
- Python
- Stars
- 385
- Forks
- 102
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 9
Description
Context
The assigned developers (among others) have been meeting during the Spring 2021 PCW to discuss a Pyresample 2.0. This issue discusses one of the changes that we think should be implemented on our road to version 2.0. Most features for version 2.0 will be backwards compatible and will not require a deprecation cycle.
For related issues, see the other issues in the v2.0 milestone (see sidebar).
Proposal
Currently, resampler classes allow for a cache_dir keyword argument to be provided to the resample method. We see this as being necessary in order to have more flexibility in the future regarding how things are cached and when they are cached. It also allows for future functionality with context managers to control when the resampler is created and destroyed along with its in-memory cache.
In addition to moving this option to the __init__ (creation) Resampler we would like to rename it to cache (from cache_dir). This should allow us to provide more functionality in the future beyond the basic on local disk storage that we use it as now (ex. provide fsspec objects to S3 storage, etc).
Additional Caching Functionality
Although this should be possible currently, we'd like to properly document that if you want to pre-fill your cache for your resampler it should be possible to do:
resampler = create_resampler(src_geom, dst_geom, cache='/some/path')
resampler.precompute(**kwargs)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.