Skip to content

Commit

Permalink
Fix remaining append bugs in test_api
Browse files Browse the repository at this point in the history
  • Loading branch information
peytondmurray committed Apr 14, 2024
1 parent 64a1644 commit 0c416c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions versioned_hdf5/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def __init__(self, value: np.ndarray):
self.value = value

def __repr__(self):
return f"WriteOperation: {self.value}"
return f"AppendOperation: {self.value}"

def apply(
self,
Expand Down Expand Up @@ -1229,7 +1229,7 @@ def append_to_dataset(
)

# Get the slices from the previous version; they are reused here
last_virtual_slice = list(sorted(slices, key=lambda obj: obj.args[0]))[-1]
last_virtual_slice = list(sorted(slices, key=lambda obj: obj.args[0].start))[-1]

# Split the data to append into a part which fits in the last
# chunk of the raw data, and the part that doesn't
Expand Down Expand Up @@ -1558,7 +1558,7 @@ def partition(
index = to_slice_tuple(obj)
shape = tuple(dim.stop for dim in index.args)

if isinstance(chunks, int):
if isinstance(chunks, (int, np.integer)):
chunks = (chunks,)

yield from ChunkSize(chunks).as_subchunks(index, shape)
Expand Down

0 comments on commit 0c416c1

Please sign in to comment.