Skip to content

Commit

Permalink
Fix error with shape of sliced objects (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche authored Dec 27, 2024
1 parent 604ce24 commit 7a08b2a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Version 0.5.1
## Version 0.5.1 - 0.5.2

- Support csc matrices in layers, although not common ran into a situation where the
anndata object was stored from R.
Expand Down
2 changes: 1 addition & 1 deletion src/cellarr/CellArrDatasetSlice.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def to_summarizedexperiment(self):

@property
def shape(self):
return self.matrix.shape
return (len(self.cell_metadata), len(self.gene_annotation))

def __len__(self):
return self.shape[0]
Expand Down
8 changes: 8 additions & 0 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,11 @@ def test_query_cellarrdataset():
for cell, cell_chunk in cd.itercells():
cell_count += 1
assert cell_count == 1100

full_row_slice = cd[1,]
assert full_row_slice is not None
assert full_row_slice.shape == (1, 1000)

full_col_slice = cd[:, 1]
assert full_col_slice is not None
assert full_col_slice.shape == (1100, 1)

0 comments on commit 7a08b2a

Please sign in to comment.