Skip to content

Commit

Permalink
Use correct shape for obsm/varm layers in anndata export (#216)
Browse files Browse the repository at this point in the history
* Fix

* Revert to original approach for obtaining n_row

* 4X perf improvement using unique+len
  • Loading branch information
aaronwolen authored Sep 12, 2024
1 parent 569c196 commit 30764e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python-spec/src/somacore/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,11 @@ def _axism_inner_ndarray(
layer: str,
) -> np.ndarray:
axism = axis.getitem_from(self._ms, suf="m")
table = axism[layer].read().tables().concat()

_, n_col = axism[layer].shape
n_row = len(axis.getattr_from(self._joinids))
n_col = len(table["soma_dim_1"].unique())

table = self._axism_inner(axis, layer).tables().concat()
return self._convert_to_ndarray(axis, table, n_row, n_col)

@property
Expand Down

0 comments on commit 30764e6

Please sign in to comment.