Skip to content

Commit

Permalink
add test for get_values(table_layer=...)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMarconato committed Jan 5, 2025
1 parent 4d3c141 commit 6a8c079
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/core/query/test_relational_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,13 @@ def test_get_values_table(sdata_blobs):
assert len(df) == 26


def test_get_values_table_different_layer(sdata_blobs):
sdata_blobs["table"].layers["layer"] = np.log1p(sdata_blobs["table"].X)
df = get_values(value_key="channel_0_sum", element=sdata_blobs["table"])
df_layer = get_values(value_key="channel_0_sum", element=sdata_blobs["table"], table_layer="layer")
assert np.allclose(np.log1p(df), df_layer)


def test_get_values_table_element_name(sdata_blobs):
sdata_blobs["table"].obs["region"] = sdata_blobs["table"].obs["region"].cat.add_categories("another_region")
sdata_blobs["table"].obs.loc["1", "region"] = "another_region"
Expand Down

0 comments on commit 6a8c079

Please sign in to comment.