Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion virtualizarr/manifests/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs) -> Any:
return _isnan(self.shape)
return NotImplemented

def __array__(self, dtype: np.typing.DTypeLike = None) -> np.ndarray:
def __array__(
self, dtype: np.typing.DTypeLike | None = None, copy: bool | None = None
) -> np.ndarray:
raise NotImplementedError(
"ManifestArrays can't be converted into numpy arrays or pandas Index objects"
)
Expand Down
11 changes: 8 additions & 3 deletions virtualizarr/manifests/array_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ def concatenate(
new_shape[axis] = new_length_along_concat_axis

# do concatenation of entries in manifest
concatenated_paths = np.concatenate(
[arr.manifest._paths for arr in arrays],
axis=axis,
concatenated_paths = (
cast( # `np.concatenate` is type hinted as if the output could have Any dtype
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume this is because of numpy's type promotion rules.

np.ndarray[Any, np.dtypes.StringDType],
np.concatenate(
[arr.manifest._paths for arr in arrays],
axis=axis,
),
)
)
concatenated_offsets = np.concatenate(
[arr.manifest._offsets for arr in arrays],
Expand Down
Loading