Skip to content

Commit

Permalink
Merge branch 'main' into refactor/store-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamman authored Nov 12, 2024
2 parents a1c2818 + 97d654b commit af30833
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/zarr/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class VindexInvalidSelectionError(IndexError):
_msg = (
"unsupported selection type for vectorized indexing; only "
"coordinate selection (tuple of integer arrays) and mask selection "
"(single Boolean array) are supported; got {0!r}"
"(single Boolean array) are supported; got {!r}"
)


Expand Down
6 changes: 3 additions & 3 deletions src/zarr/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ def __init__(self, *args: Any) -> None:


class ContainsGroupError(_BaseZarrError):
_msg = "A group exists in store {0!r} at path {1!r}."
_msg = "A group exists in store {!r} at path {!r}."


class ContainsArrayError(_BaseZarrError):
_msg = "An array exists in store {0!r} at path {1!r}."
_msg = "An array exists in store {!r} at path {!r}."


class ContainsArrayAndGroupError(_BaseZarrError):
_msg = (
"Array and group metadata documents (.zarray and .zgroup) were both found in store "
"{0!r} at path {1!r}."
"{!r} at path {!r}. "
"Only one of these files may be present in a given directory / prefix. "
"Remove the .zarray file, or the .zgroup file, or both."
)
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/storage/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def __str__(self) -> str:
return _dereference_path(str(self.store), self.path)

def __repr__(self) -> str:
return f"StorePath({self.store.__class__.__name__}, {str(self)!r})"
return f"StorePath({self.store.__class__.__name__}, '{self}')"

def __eq__(self, other: object) -> bool:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/storage/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __str__(self) -> str:
return f"file://{self.root.as_posix()}"

def __repr__(self) -> str:
return f"LocalStore({str(self)!r})"
return f"LocalStore('{self}')"

def __eq__(self, other: object) -> bool:
return isinstance(other, type(self)) and self.root == other.root
Expand Down
4 changes: 2 additions & 2 deletions src/zarr/storage/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __str__(self) -> str:
return f"memory://{id(self._store_dict)}"

def __repr__(self) -> str:
return f"MemoryStore({str(self)!r})"
return f"MemoryStore('{self}')"

def __eq__(self, other: object) -> bool:
return (
Expand Down Expand Up @@ -203,7 +203,7 @@ def __str__(self) -> str:
return f"gpumemory://{id(self._store_dict)}"

def __repr__(self) -> str:
return f"GpuMemoryStore({str(self)!r})"
return f"GpuMemoryStore('{self}')"

@classmethod
def from_dict(cls, store_dict: MutableMapping[str, Buffer]) -> Self:
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/storage/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __str__(self) -> str:
return f"zip://{self.path}"

def __repr__(self) -> str:
return f"ZipStore({str(self)!r})"
return f"ZipStore('{self}')"

def __eq__(self, other: object) -> bool:
return isinstance(other, type(self)) and self.path == other.path
Expand Down

0 comments on commit af30833

Please sign in to comment.