Skip to content

Commit

Permalink
ignore remaining mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Jun 18, 2024
1 parent e53157e commit daaa331
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions virtualizarr/manifests/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ChunkManifest:
so it's not possible to have a ChunkManifest object that does not represent a valid grid of chunks.
"""

_paths: np.ndarray[Any, np.dtypes.StringDType]
_paths: np.ndarray[Any, np.dtypes.StringDType] # type: ignore[name-defined]
_offsets: np.ndarray[Any, np.dtype[np.int32]]
_lengths: np.ndarray[Any, np.dtype[np.int32]]

Expand Down Expand Up @@ -99,7 +99,7 @@ def __init__(self, entries: dict) -> None:
shape = get_chunk_grid_shape(entries.keys())

# Initializing to empty implies that entries with path='' are treated as missing chunks
paths = np.empty(shape=shape, dtype=np.dtypes.StringDType())
paths = np.empty(shape=shape, dtype=np.dtypes.StringDType()) # type: ignore[attr-defined]
offsets = np.empty(shape=shape, dtype=np.dtype("int32"))
lengths = np.empty(shape=shape, dtype=np.dtype("int32"))

Expand Down Expand Up @@ -127,7 +127,7 @@ def __init__(self, entries: dict) -> None:
@classmethod
def from_arrays(
cls,
paths: np.ndarray[Any, np.dtype[np.dtypes.StringDType]],
paths: np.ndarray[Any, np.dtype[np.dtypes.StringDType]], # type: ignore[name-defined]
offsets: np.ndarray[Any, np.dtype[np.int32]],
lengths: np.ndarray[Any, np.dtype[np.int32]],
) -> "ChunkManifest":
Expand Down Expand Up @@ -157,7 +157,7 @@ def from_arrays(
)

# check dtypes
if paths.dtype != np.dtypes.StringDType():
if paths.dtype != np.dtypes.StringDType(): # type: ignore[attr-defined]
raise ValueError(
f"paths array must have a numpy variable-length string dtype, but got dtype {paths.dtype}"
)
Expand Down
2 changes: 1 addition & 1 deletion virtualizarr/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def replace(
compressor: Optional[str] = None,
dtype: Optional[np.dtype] = None,
fill_value: Optional[float] = None, # float or int?
filters: Optional[list[dict]] = None,
filters: Optional[list[dict]] = None, # type: ignore[valid-type]
order: Optional[Literal["C"] | Literal["F"]] = None,
shape: Optional[tuple[int, ...]] = None,
zarr_format: Optional[Literal[2] | Literal[3]] = None,
Expand Down

0 comments on commit daaa331

Please sign in to comment.