Skip to content

Commit

Permalink
Merge pull request #65 from valeriupredoi/fix_Bryan_voodoo
Browse files Browse the repository at this point in the history
Pin Zarr >=2.13.6 so we use new FSStore objects (instead of KVStore)
  • Loading branch information
valeriupredoi authored Mar 7, 2023
2 parents 81f6bef + cb4b526 commit 56ad427
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions activestorage/active.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,12 @@ def _get_selection(self, *args):
stripped_indexer = [(a, b, c) for a,b,c in indexer]
drop_axes = indexer.drop_axes # not sure what this does and why, yet.

# yes this next line is bordering on voodoo ...
fsref = self.zds.chunk_store._mutable_mapping.fs.references
# yes this next line is bordering on voodoo ...
# this returns a nested dictionary with the full file FS reference
# ie all the gubbins: chunks, data structure, types, etc
# if using zarr<=2.13.3 call with _mutable_mapping ie
# fsref = self.zds.chunk_store._mutable_mapping.fs.references
fsref = self.zds.chunk_store.fs.references

return self._from_storage(stripped_indexer, drop_axes, out_shape,
out_dtype, compressor, filters, missing, fsref)
Expand Down
4 changes: 3 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ dependencies:
- pip !=21.3
- pytest
- xarray
- zarr <=2.13.3 # github.com/valeriupredoi/PyActiveStorage/issues/62
# pin Zarr to avoid using old KVStore interface
# see github.com/zarr-developers/zarr-python/issues/1362
- zarr >=2.13.6 # KVStore to FSStore
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
'netcdf4',
'pytest',
'xarray',
'zarr<=2.13.3', # github.com/valeriupredoi/PyActiveStorage/issues/62
# pin Zarr to use new FSStore instead of KVStore
'zarr>=2.13.3', # github.com/zarr-developers/zarr-python/issues/1362
# for testing
'pytest-cov>=2.10.1',
'pytest-xdist',
Expand Down

0 comments on commit 56ad427

Please sign in to comment.