Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fe49f5f
fix: zarr v2 compatability fixes
jhamman Sep 14, 2024
9a1580b
move zarr.store to zarr.storage
jhamman Sep 16, 2024
0d89912
make chunks a tuple
jhamman Sep 17, 2024
d78e384
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 17, 2024
e534279
Apply suggestions from code review
jhamman Sep 17, 2024
dea4a3d
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 18, 2024
7800f38
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 22, 2024
93b61fc
more merge conflict resolution
jhamman Sep 23, 2024
88afe52
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 29, 2024
fb6752d
fixups
jhamman Sep 29, 2024
0b1dedc
fixup zipstore
jhamman Sep 29, 2024
322918a
Apply suggestions from code review
jhamman Sep 29, 2024
a95d54a
Apply suggestions from code review
jhamman Sep 30, 2024
128eb53
add test
jhamman Sep 30, 2024
3c170ef
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 30, 2024
54ab9ef
extend test
jhamman Sep 30, 2024
77f2938
clean up parents
jhamman Sep 30, 2024
2295d76
debug race condition
jhamman Sep 30, 2024
5879d67
more debug
jhamman Sep 30, 2024
f54f6f2
document storage classes and some developer apis
jhamman Oct 1, 2024
3940d22
Update src/zarr/core/array.py
jhamman Oct 1, 2024
c9d1c50
Merge branch 'fix/dask-compat' into doc/storage
jhamman Oct 2, 2024
83fa3ac
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Oct 7, 2024
f2137fb
Merge branch 'doc/storage' of github.com:jhamman/zarr-python into doc…
jhamman Oct 7, 2024
f44601b
Merge branch 'v3' into doc/storage
jhamman Oct 9, 2024
731c22a
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Oct 10, 2024
4e93aa0
inherit docstrings from baseclass
jhamman Oct 10, 2024
dad94e2
Merge branch 'doc/storage' of github.com:jhamman/zarr-python into doc…
jhamman Oct 10, 2024
5477d32
fix sphinx warning
jhamman Oct 11, 2024
728d4f7
# docstring inherited
jhamman Oct 11, 2024
e293b47
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Oct 11, 2024
cee730c
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Oct 11, 2024
3f7290f
add storage guide
jhamman Oct 11, 2024
35a6428
add missing file
jhamman Oct 11, 2024
a78461e
update links
jhamman Oct 11, 2024
eff01ce
Merge branch 'v3' into doc/storage
jhamman Oct 11, 2024
c1f0923
Merge branch 'v3' into doc/storage
dstansby Oct 12, 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
Prev Previous commit
Next Next commit
…nto doc/storage
  • Loading branch information
jhamman committed Oct 10, 2024
commit 731c22ac61387619b965339a2bfc18fd60e5c64e
21 changes: 6 additions & 15 deletions src/zarr/abc/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ def from_literal(cls, mode: AccessModeLiteral) -> Self:
class Store(ABC):
"""
Abstract base class for Zarr stores.

Attributes
----------
_mode : AccessMode
Access mode flags.
_is_open : bool
Whether the store is open.
"""

_mode: AccessMode
Expand All @@ -92,7 +85,7 @@ async def open(cls, *args: Any, **kwargs: Any) -> Self:

Returns
-------
store
Store
The opened store instance.
"""
store = cls(*args, **kwargs)
Expand All @@ -116,16 +109,16 @@ async def _open(self) -> None:
"""
Open the store.

Notes
-----
* When `mode='w'` and the store already exists, it will be cleared.

Raises
------
ValueError
If the store is already open.
FileExistsError
If `mode='w-'` and the store already exists.
If ``mode='w-'`` and the store already exists.

Notes
-----
* When ``mode='w'`` and the store already exists, it will be cleared.
"""
if self._is_open:
raise ValueError("store is already open")
Expand Down Expand Up @@ -158,7 +151,6 @@ async def clear(self) -> None:
Clear the store.

Remove all keys and values from the store.

"""
...

Expand Down Expand Up @@ -427,7 +419,6 @@ async def set_or_delete(byte_setter: ByteSetter, value: Buffer | None) -> None:
Notes
-----
If value is None, the key will be deleted.

"""
if value is None:
await byte_setter.delete()
Expand Down
4 changes: 2 additions & 2 deletions src/zarr/storage/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def exists(self) -> bool:

Returns
-------
exists : bool
bool
True if the key exists in the store, False otherwise.
"""
return await self.store.exists(self.path)
Expand All @@ -138,7 +138,7 @@ def __eq__(self, other: object) -> bool:

Returns
-------
equals : bool
bool
True if the two objects are equal, False otherwise.

Notes
Expand Down
4 changes: 1 addition & 3 deletions src/zarr/storage/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class LoggingStore(Store):

Attributes
----------
_store: Store
Wrapped store
counter: dict
Counter of number of times each method has been called
"""
Expand Down Expand Up @@ -78,7 +76,7 @@ def _default_handler(self) -> logging.Handler:

@contextmanager
def log(self) -> Generator[None, None, None]:
"""context manager to log method calls
"""Context manager to log method calls

Each call to the wrapped store is logged to the configured logger and added to
the counter dict.
Expand Down
10 changes: 5 additions & 5 deletions src/zarr/storage/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class RemoteStore(Store):

Parameters
----------
fs: AsyncFileSystem
fs : AsyncFileSystem
The Async FSSpec filesystem to use with this store.
mode: AccessModeLiteral
mode : AccessModeLiteral
The access mode to use.
path: str
path : str
The root path of the store.
allowed_exceptions: tuple[type[Exception], ...]
When fetching data, these cases will be deemed to correspond to missing
allowed_exceptions : tuple[type[Exception], ...]
When fetching data, these cases will be deemed to correspond to missing keys.

Attributes
----------
Expand Down
4 changes: 0 additions & 4 deletions src/zarr/storage/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ class ZipStore(Store):
extensions when the zipfile is larger than 2 GiB. If False
will raise an exception when the ZIP file would require ZIP64
extensions.
mode : string, optional
One of 'r' to read an existing file, 'w' to truncate and write a new
file, 'a' to append to an existing file, or 'x' to exclusively create
and write a new file.

Attributes
----------
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.