Skip to content

Commit

Permalink
fixed broken backwards compat in restrict_to key_added name
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf committed May 2, 2019
1 parent 0802a4d commit d6ca1b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scanpy/tools/_leiden.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def leiden(
# store output into adata.obs
groups = np.array(part.membership)
if restrict_to is not None:
if key_added == 'louvain':
key_added += '_R'
groups = rename_groups(
adata,
key_added,
Expand Down
2 changes: 2 additions & 0 deletions scanpy/tools/_louvain.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ def louvain(
else:
raise ValueError('`flavor` needs to be "vtraag" or "igraph" or "taynaud".')
if restrict_to is not None:
if key_added == 'louvain':
key_added += '_R'
groups = rename_groups(
adata,
key_added,
Expand Down

0 comments on commit d6ca1b8

Please sign in to comment.