-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add a simple local file cache for img_tiles. #795
Conversation
Cache implementation using shelve. | ||
|
||
If appdirs is available, the proper user_cache_dir for the system will | ||
be used, otherwise the current working directory will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that's the best place; there's a config
setting that might be a better default.
101f9fa
to
6c1833a
Compare
6c1833a
to
0a62adb
Compare
what is the status of this PR? Looks like it would be an excellent use case for me. I use jupyter notebooks to tweak plots and I sometimes run the same bounding box with the same tiles dozens of times while I test the different aestethics of the visualization. Caching would be ideal in this case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will also need a CLA in place before this goes in, if there's still interest.
pass | ||
|
||
|
||
class ShelveTileCache(TileCache): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how easy duck typing is in Python, I would eliminate the TileCache
base class
I would also say we should just implement __getitem__
and __setitem__
to make the interface more Pythonic. Or at least that's my inclination.
This was superseded by #1533, closing for now, but feel free to reopen if you think there is something else to be done here still. |
This should close #732. This is probably a common enough use case to be included as an option.
Geotiler also includes a redis cache which could easily be added here.