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

Merged
merged 78 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
78 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
41ec08f
add reader_kwargs argument to open_virtual_dataset, and pass it down …
TomNicholas Nov 23, 2024
b4cc617
Merge branch 'main' into reader_kwargs
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
001f95b
Merge branch 'reader_kwargs' into paths_as_uris
TomNicholas Nov 23, 2024
15ae139
add dmrpp relative path integration test
ayushnag Nov 24, 2024
b3432c6
Merge branch 'main' into paths_as_uris
TomNicholas Nov 26, 2024
ae00ac3
Merge branch 'main' into paths_as_uris
TomNicholas Nov 27, 2024
ddc19c3
Merge branch 'main' into filepath_test_dmrpp
TomNicholas Nov 27, 2024
8353a9b
fix kerchunk relative paths test by pluggin through fs_root kwarg
TomNicholas Nov 27, 2024
251469f
Merge branch 'filepath_test_dmrpp' of https://github.com/ayushnag/Vir…
TomNicholas Nov 27, 2024
0915433
fix dmrpp tests by using absolute filepaths in DMR++ contents
TomNicholas Nov 27, 2024
3ca8f7f
clarify new dmrpp test
TomNicholas Nov 27, 2024
8a90ec7
test handling of relative filepaths to dmrpp files
TomNicholas Nov 27, 2024
4afa34c
group related tests
TomNicholas Nov 27, 2024
da9ee10
removed cloudpathlib from validation code
TomNicholas Dec 1, 2024
3557008
fix bug but restrict fs_root to only handle filesystem paths, not buc…
TomNicholas Dec 2, 2024
ca09096
global list of recognized URI prefixes
TomNicholas Dec 2, 2024
7727d4e
cleanup
TomNicholas Dec 2, 2024
03aa6bc
remove cloudpathlib from dependencies
TomNicholas Dec 2, 2024
4d8ceea
fix/ignore some typing errors
TomNicholas Dec 2, 2024
cd5bec1
rewrite tests to use a new dmrparser_factory
TomNicholas Dec 3, 2024
e521e20
rewrite using global dict of XML strings
TomNicholas Dec 3, 2024
4ff17d0
fix final test by explicitly passing in tmp_path instead of using a f…
TomNicholas Dec 3, 2024
7e0be24
Merge branch 'dmrpp_tests_tmp_path' into paths_as_uris
TomNicholas Dec 3, 2024
bf0bb87
fix bug with not converting Path objects to strings
TomNicholas Dec 3, 2024
25acdf9
Merge branch 'dmrpp_tests_tmp_path' into paths_as_uris
TomNicholas Dec 3, 2024
ac04cef
dmrpp relative paths tests passing
TomNicholas Dec 3, 2024
39bbfaf
fix type hint for filetype kwarg
TomNicholas Dec 3, 2024
9b6906b
Merge branch 'main' into paths_as_uris
TomNicholas Dec 3, 2024
0127f05
user documentation on fs_root
TomNicholas Dec 3, 2024
cd5da5d
change example manifests to use URIs
TomNicholas Dec 3, 2024
df6663f
reminder that rename_paths exists
TomNicholas Dec 3, 2024
be20994
Merge branch 'paths_as_uris' of https://github.com/TomNicholas/Virtua…
TomNicholas Dec 3, 2024
528f722
update release notes
TomNicholas Dec 3, 2024
a8d5a15
remove note about .rename_paths
TomNicholas Dec 3, 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 @@ -17,6 +17,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 @@ -50,6 +54,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