-
Notifications
You must be signed in to change notification settings - Fork 63
Add ObjectStoreRegistry to support default stores #549
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d71b343
Add default_object_store internal func
maxrjones d1faa78
Remove TODO because lack of duplicate keys are useful
maxrjones c360707
Also return prefix
maxrjones 938ff3b
Remove config complexity
maxrjones 7ed96f4
Make _find_matching_store a method
maxrjones 89f3f3a
Test default store creation with HDF5 reader
maxrjones 34f9d0c
Improve typing
maxrjones 7094212
Protect against duplicate config options
maxrjones 78f483f
Mark minio tests
maxrjones 6c901bf
Fix test
maxrjones cd5fc34
Specify that other schemes aren't supported
maxrjones 6899e79
Make mypy pass
maxrjones 1bf5495
Revise codecov config
maxrjones bc26ebb
Apply suggestions from code review
maxrjones e503df6
Revert pyproject.toml change
maxrjones 62fd065
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d8e5fd5
Refactor as ObjectStoreRegistry
maxrjones 53a26ee
Fix typing
maxrjones 4bd9e2b
Improve docstrings
maxrjones 77a0124
Fix store parsing
maxrjones 4e0b92c
Update hdf reader to use ObjectStoreRegistry
maxrjones ca48b6c
Infer region from HEAD request
maxrjones bc41e9b
Remove overloads that upset mypy
maxrjones ad7c003
Update virtualizarr/manifests/store.py
maxrjones 1ee867b
Remove mypy from pre-commit
maxrjones e96f6c8
Use scheme and netlock as registry keys
maxrjones 2d84e2c
Remove unused function
maxrjones 7e9233f
Update docstrings
maxrjones e3a6267
Consolidate imports
maxrjones 9fe8af3
Add docstring
maxrjones f183f9d
Remove type-ignore
maxrjones File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ | |
| ManifestStore, | ||
| ) | ||
| from virtualizarr.manifests.manifest import validate_and_normalize_path_to_uri | ||
| from virtualizarr.manifests.store import ObjectStoreRegistry, default_object_store | ||
| from virtualizarr.manifests.utils import create_v3_array_metadata | ||
| from virtualizarr.readers.api import VirtualBackend | ||
| from virtualizarr.readers.hdf.filters import cfcodec_from_dataset, codecs_from_dataset | ||
|
|
@@ -156,16 +157,18 @@ def _construct_manifest_group( | |
| def _create_manifest_store( | ||
| filepath: str, | ||
| *, | ||
| prefix: str, | ||
| store: ObjectStore, | ||
| store: ObjectStore | None = None, | ||
|
Comment on lines
-159
to
+160
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sharkinsspatial with using the scheme + bucket for the ObjectStoreRegistry keys, we no longer need the prefix argument for |
||
| group: str | None = None, | ||
| ) -> ManifestStore: | ||
| # Create a group containing dataset level metadata and all the manifest arrays | ||
| if not store: | ||
| store = default_object_store(filepath) # type: ignore | ||
| manifest_group = HDFVirtualBackend._construct_manifest_group( | ||
| store=store, filepath=filepath, group=group | ||
| ) | ||
| registry = ObjectStoreRegistry({filepath: store}) | ||
| # Convert to a manifest store | ||
| return ManifestStore(stores={prefix: store}, group=manifest_group) | ||
| return ManifestStore(store_registry=registry, group=manifest_group) | ||
|
|
||
| @staticmethod | ||
| def open_virtual_dataset( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.