Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 20, 2024
1 parent 98a1be8 commit b0b6f97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lgdo/lh5/_serializers/read/vector_of_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _h5_read_vector_of_vectors(
# if the buffer is partially filled, cumulative_length will be invalid
# (i.e. non monotonically increasing). Let's fix that but filling the
# rest of the array with the length of flattened_data
if n_rows_read>0:
if n_rows_read > 0:
end = obj_buf_start + n_rows_read
obj_buf.cumulative_length.nda[end:] = obj_buf.cumulative_length.nda[end - 1]

Expand Down
11 changes: 3 additions & 8 deletions tests/lh5/test_lh5_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,21 +472,16 @@ def test_read_lgnd_vov_fancy_idx(lgnd_file):
assert (lh5_obj.cumulative_length.nda == [1, 2, 3, 4, 5, 6, 7]).all()
assert (lh5_obj.flattened_data.nda == [40, 60, 64, 60, 64, 28, 60]).all()

lh5_obj, n_rows = store.read(
"/geds/raw/tracelist", lgnd_file, idx=[]
)
lh5_obj, n_rows = store.read("/geds/raw/tracelist", lgnd_file, idx=[])
assert isinstance(lh5_obj, types.VectorOfVectors)
assert n_rows == 0
assert len(lh5_obj) == 0


lh5_obj, n_rows = store.read(
"/geds/raw/tracelist", [lgnd_file]*3, idx=[250]
)
lh5_obj, n_rows = store.read("/geds/raw/tracelist", [lgnd_file] * 3, idx=[250])
assert isinstance(lh5_obj, types.VectorOfVectors)
assert n_rows == 1
assert len(lh5_obj) == 1


def test_read_array_concatenation(lgnd_file):
store = lh5.LH5Store()
Expand Down

0 comments on commit b0b6f97

Please sign in to comment.