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

add InMemoryBackend #163

Merged
merged 7 commits into from Feb 5, 2021
Merged

add InMemoryBackend #163

merged 7 commits into from Feb 5, 2021

Conversation

vincentsarago
Copy link
Member

closes #152

minzoom: int = attr.ib(init=False, default=0)
maxzoom: int = attr.ib(init=False, default=30)

path: str = attr.ib(init=False, default=":memory:")
Copy link
Member Author

Choose a reason for hiding this comment

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

path is outside the __init__ and will always default to :memory:

@@ -16,8 +17,11 @@ def MosaicBackend(url: str, *args: Any, **kwargs: Any) -> BaseBackend:
"""Select mosaic backend for url."""
parsed = urlparse(url)

if not url or url == ":memory:":
return InMemoryBackend(*args, **kwargs)
Copy link
Member Author

Choose a reason for hiding this comment

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

if url is ":memory:" or set to None we use the InMemoryBackend

docs/advanced/backends.md Show resolved Hide resolved
docs/advanced/backends.md Outdated Show resolved Hide resolved
docs/advanced/backends.md Outdated Show resolved Hide resolved
cogeo_mosaic/backends/memory.py Outdated Show resolved Hide resolved
vincentsarago and others added 6 commits February 4, 2021 23:08
Co-authored-by: Kyle Barron <kylebarron2@gmail.com>
Co-authored-by: Kyle Barron <kylebarron2@gmail.com>
Co-authored-by: Kyle Barron <kylebarron2@gmail.com>
@vincentsarago vincentsarago merged commit 098dcac into master Feb 5, 2021
@vincentsarago vincentsarago deleted the inMemoryBackend2 branch February 5, 2021 04:19
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.

In-memory mosaic backend
2 participants