Skip to content

Commit

Permalink
Add test coverage for lineage channel indices
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin931 committed Dec 28, 2024
1 parent 66668c7 commit 9196d87
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,21 @@ def test_subset_channels(self):
assert exprs.n_channels == 2
assert exprs.lineage_channels is not None
assert exprs.lineage_channels.shape[0] == 2
assert np.all(np.equal(exprs._lineage_channels_indices, np.array([0, 1])))
assert not np.isin("Channel0", exprs.lineage_channels)


def test_subset_channels_lineage_indices(self):
exprs_matrix: np.ndarray = np.random.rand(100, 10)
channels: np.ndarray = np.arange(10).astype(str)
exprs = PyCytoData(exprs_matrix, channels=channels)
exprs.subset(channels=["1", "2"])
assert exprs.n_cells == 100
assert exprs.n_channels == 2
assert exprs.lineage_channels is None
assert exprs._lineage_channels_indices.shape[0] == 2
assert np.all(np.equal(exprs._lineage_channels_indices, np.array([0, 1])))
assert not np.isin("0", exprs.lineage_channels)


def test_subset_cell_types(self):
Expand Down

0 comments on commit 9196d87

Please sign in to comment.