Skip to content

Commit

Permalink
try explicitly separating files from directories
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Apr 9, 2024
1 parent 0151652 commit 6ba41de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 0 additions & 2 deletions virtualizarr/tests/test_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ def test_zarr_v3_roundtrip(tmpdir):
roundtrip = open_virtual_dataset(tmpdir / "store.zarr", filetype="zarr_v3", indexes={})

xrt.assert_identical(roundtrip, original)

assert False
9 changes: 6 additions & 3 deletions virtualizarr/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,17 @@ def open_virtual_dataset_from_v3_store(
ds_attrs = attrs_from_zarr_group_json(_storepath / "zarr.json")

# TODO recursive glob to create a datatree
# Note: this .is_file() check should not be necessary according to the pathlib docs, but tests fail on github CI without it
# see https://github.com/TomNicholas/VirtualiZarr/pull/45#discussion_r1547833166
all_paths = _storepath.glob("*/")
directory_paths = [p for p in all_paths if not p.is_file()]

vars = {}
for array_dir in _storepath.glob("*/"):
for array_dir in directory_paths:
var_name = array_dir.name
if var_name in drop_variables:
break

print(array_dir)

zarray, dim_names, attrs = metadata_from_zarr_json(array_dir / "zarr.json")
manifest = ChunkManifest.from_zarr_json(str(array_dir / "manifest.json"))

Expand Down

0 comments on commit 6ba41de

Please sign in to comment.