Skip to content

Commit

Permalink
WIP: Use IPFSFileSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Apr 29, 2022
1 parent 8a72b75 commit a64e888
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions test/test_spatial_image_multiscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@
def input_images():
result = {}

# store = IPFS_FS.get_mapper(f"ipfs://{IPFS_CID}/input/cthead1.zarr")
store = DirectoryStore(
DATA_PATH / 'input' / 'cthead1.zarr',
dimension_separator='/'
)
store = IPFS_FS.get_mapper(f"ipfs://{IPFS_CID}/input/cthead1.zarr")
# store = DirectoryStore(
# DATA_PATH / 'input' / 'cthead1.zarr',
# dimension_separator='/'
# )
image_ds = xr.open_zarr(store)
image_da = image_ds.cthead1
result["cthead1"] = image_da

store = DirectoryStore(
DATA_PATH / 'input' / 'small_head.zarr',
dimension_separator='/'
)
store = IPFS_FS.get_mapper(f"ipfs://{IPFS_CID}/input/small_head.zarr")
# store = DirectoryStore(
# DATA_PATH / 'input' / 'small_head.zarr',
# dimension_separator='/'
# )
image_ds = xr.open_zarr(store)
image_da = image_ds.small_head
result["small_head"] = image_da
Expand All @@ -39,13 +40,13 @@ def input_images():


def verify_against_baseline(dataset_name, baseline_name, multiscale):
store = DirectoryStore(
DATA_PATH / f"baseline/{dataset_name}/{baseline_name}",
dimension_separator='/'
)
# store = IPFS_FS.get_mapper(
# f"ipfs://{IPFS_CID}/baseline/{dataset_name}/{baseline_name}"
# store = DirectoryStore(
# DATA_PATH / f"baseline/{dataset_name}/{baseline_name}",
# dimension_separator='/'
# )
store = IPFS_FS.get_mapper(
f"ipfs://{IPFS_CID}/baseline/{dataset_name}/{baseline_name}"
)
dt = open_datatree(store, engine="zarr", mode="r")
xr.testing.assert_equal(dt.ds, multiscale.ds)
for scale in multiscale.children:
Expand Down

0 comments on commit a64e888

Please sign in to comment.