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

Paths as URIs #243

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c787da4
validate that paths can be coerced to valid URIs
TomNicholas Oct 2, 2024
b2f3f26
add a test that paths are converted to URIs
TomNicholas Oct 2, 2024
6b15d9e
added test and better error if local path is not absolute
TomNicholas Oct 2, 2024
045cc7a
raise more informative error if path is not absolute
TomNicholas Oct 2, 2024
ddc6b7f
test that empty paths are allowed
TomNicholas Oct 2, 2024
61bf5d6
add failing test for raising on malformed paths
TomNicholas Oct 2, 2024
2896bd8
fix paths in tests
TomNicholas Oct 2, 2024
584adf9
fix more tests
TomNicholas Oct 2, 2024
14b8ca3
remove the file:/// prefix when writing to kerchunk format
TomNicholas Oct 2, 2024
bad0b1b
Merge branch 'main' into paths_as_uris
TomNicholas Oct 19, 2024
739a6bd
absolute paths in recently-added tests
TomNicholas Oct 19, 2024
06f3a4d
absolute paths in recently-added tests
TomNicholas Oct 19, 2024
3d50def
fix one more test
TomNicholas Oct 20, 2024
b37f8d0
Merge branch 'main' into paths_as_uris
TomNicholas Nov 21, 2024
a9bd0a3
stop wrapping specific error in less useful one
TomNicholas Nov 21, 2024
f0bc445
moved remaining kerchunk parsing logic out into translator file
TomNicholas Nov 21, 2024
b224af8
add fs_root parameter to validation fn
TomNicholas Nov 21, 2024
c8d513c
demote ChunkEntry to a TypedDict to separate validation fn
TomNicholas Nov 21, 2024
4ad26cf
actually instead add new constructor method to TypedDict
TomNicholas Nov 21, 2024
7aaaabf
test kerchunk writer with absolute paths
TomNicholas Nov 21, 2024
f66ed79
make kerchunk reader tests pass
TomNicholas Nov 21, 2024
e30ab05
try to implement the fs_root concatenation
TomNicholas Nov 21, 2024
0a4a11d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2024
98644a7
implementation using cloudpathlib working
TomNicholas Nov 22, 2024
4499cf9
check that fs_root doesn't have a filetype suffix
TomNicholas Nov 22, 2024
d27bdf6
add cloudpathlib to dependencies
TomNicholas Nov 22, 2024
fefab90
allow http paths, and require file suffixes
TomNicholas Nov 22, 2024
927121c
unit tests for path validation
TomNicholas Nov 22, 2024
c561a5d
test whether we can catch malformed paths
TomNicholas Nov 22, 2024
d42ff33
test fs_root
TomNicholas Nov 22, 2024
4b7cd2d
add (unimplemented) validate_entries kwarg to .from_arrays
TomNicholas Nov 23, 2024
0f8b550
add .keys(), .values(), .items()
TomNicholas Nov 23, 2024
8055ba7
test validate_paths during .from_arrays
TomNicholas Nov 23, 2024
f18bf59
ensure validation actually normalizes paths to uris
TomNicholas Nov 23, 2024
96f6360
test .rename_paths correctly validates paths
TomNicholas Nov 23, 2024
b2ed1cd
some release notes
TomNicholas Nov 23, 2024
87fad80
remove now-superfluous coercion to URI in icechunk writer
TomNicholas Nov 23, 2024
1f41d69
added link to icechunk writer performance benchmark
TomNicholas Nov 23, 2024
ffff93e
Merge branch 'main' into paths_as_uris
TomNicholas Nov 23, 2024
26e8950
Merge branch 'main' into paths_as_uris
TomNicholas Nov 23, 2024
19c13ae
ensure relative paths containing .. can be normalized
TomNicholas Nov 23, 2024
6ce7ebd
ensure HDF5 reader always returns absolute URIs
TomNicholas Nov 23, 2024
24b6ea7
ensure HDF reader always returns absolute URIs
TomNicholas Nov 23, 2024
5f0f362
add relative path handling to other kerchunk-based readers
TomNicholas Nov 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- ujson
- packaging
- universal_pathlib
- cloudpathlib
- hdf5plugin
- numcodecs
# Testing
Expand Down
1 change: 1 addition & 0 deletions ci/min-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- packaging
- ujson
- universal_pathlib
- cloudpathlib
# Testing
- codecov
- pre-commit
Expand Down
1 change: 1 addition & 0 deletions ci/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- packaging
- ujson
- universal_pathlib
- cloudpathlib
- hdf5plugin
- numcodecs
- imagecodecs>=2024.6.1
Expand Down
6 changes: 6 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Breaking changes

- Minimum required version of Xarray is now v2024.10.0.
(:pull:`284`) By `Tom Nicholas <https://github.com/TomNicholas>`_.
- File paths in chunk manifests must now be absolute paths, relative paths are now forbidden.
(:pull:`243`) By `Tom Nicholas <https://github.com/TomNicholas>`_.
- Added a depedency on cloudpathlib.
(:pull:`243`) By `Tom Nicholas <https://github.com/TomNicholas>`_.

Deprecations
~~~~~~~~~~~~
Expand Down Expand Up @@ -47,6 +51,8 @@ Internal Changes
(:pull:`87`) By `Sean Harkins <https://github.com/sharkinsspatial>`_.
- Support downstream type checking by adding py.typed marker file.
(:pull:`306`) By `Max Jones <https://github.com/maxrjones>`_.
- File paths in chunk manifests are now always stored as abolute URIs.
(:pull:`243`) By `Tom Nicholas <https://github.com/TomNicholas>`_.

.. _v1.1.0:

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies = [
"numpy>=2.0.0",
"packaging",
"universal-pathlib",
"cloudpathlib",
"numcodecs",
"ujson",
]
Expand Down Expand Up @@ -59,7 +60,6 @@ test = [
"virtualizarr[hdf_reader]"
]


[project.urls]
Home = "https://github.com/TomNicholas/VirtualiZarr"
Documentation = "https://github.com/TomNicholas/VirtualiZarr/blob/main/README.md"
Expand Down
19 changes: 0 additions & 19 deletions virtualizarr/manifests/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
_isnan,
)
from virtualizarr.manifests.manifest import ChunkManifest
from virtualizarr.types.kerchunk import KerchunkArrRefs
from virtualizarr.zarr import ZArray


Expand Down Expand Up @@ -62,24 +61,6 @@ def __init__(
self._zarray = _zarray
self._manifest = _chunkmanifest

@classmethod
def _from_kerchunk_refs(cls, arr_refs: KerchunkArrRefs) -> "ManifestArray":
from virtualizarr.translators.kerchunk import (
fully_decode_arr_refs,
parse_array_refs,
)

decoded_arr_refs = fully_decode_arr_refs(arr_refs)

chunk_dict, zarray, _zattrs = parse_array_refs(decoded_arr_refs)
manifest = ChunkManifest._from_kerchunk_chunk_dict(chunk_dict)

obj = object.__new__(cls)
obj._manifest = manifest
obj._zarray = zarray

return obj

@property
def manifest(self) -> ChunkManifest:
return self._manifest
Expand Down
Loading
Loading