Skip to content

Commit

Permalink
Fix code style by black
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirShitov committed Jun 19, 2023
1 parent 5895045 commit da8671c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ehrapy/tools/_scanpy_tl_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def rank_features_groups(

if adata.uns["numerical_columns"]:
# Rank numerical features

# Without copying `numerical_adata` is a view, and code throws an error
# because of "object" type of .X
numerical_adata = adata[:, adata.uns["numerical_columns"]].copy()
Expand Down
10 changes: 8 additions & 2 deletions tests/tools/test_features_ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def _is_sorted(arr: np.array):
adata.uns["rank_features_groups"] = {
"params": {"whatever": "here is", "it does": "not matter", "but this key should be": "present for testing"},
"names": pd.DataFrame(
{"group1": ("feature2", "feature1", "feature4", "feature3"), "group2": ("feature5", "feature6", "feature7", "feature8")}
{
"group1": ("feature2", "feature1", "feature4", "feature3"),
"group2": ("feature5", "feature6", "feature7", "feature8"),
}
).to_records(index=False),
# Let's mix features in group1, and leave them sorted in group2
"pvals": pd.DataFrame({"group1": (0.02, 0.01, 1.00, 0.03), "group2": (0.04, 0.05, 0.06, 0.99)}).to_records(
Expand Down Expand Up @@ -72,7 +75,10 @@ def test_save_rank_features_result(self):
}

names = pd.DataFrame(
{"group1": ("feature2", "feature1", "feature4", "feature3"), "group2": ("feature5", "feature6", "feature7", "feature8")}
{
"group1": ("feature2", "feature1", "feature4", "feature3"),
"group2": ("feature5", "feature6", "feature7", "feature8"),
}
).to_records(index=False)
pvals = pd.DataFrame({"group1": (0.02, 0.01, 1.00, 0.03), "group2": (0.04, 0.05, 0.06, 0.99)}).to_records(
index=False
Expand Down

0 comments on commit da8671c

Please sign in to comment.