Skip to content

Commit

Permalink
pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovarrone committed Aug 19, 2024
1 parent b93dbe6 commit ce55415
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/cellcharter/tl/_autok.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def fit(self, adata: ad.AnnData, use_rep: str = "X_cellcharter"):
use_rep
Key in :attr:`anndata.AnnData.obsm` to use as data to fit the clustering model. If ``None``, uses :attr:`anndata.AnnData.X`.
"""

if use_rep not in adata.obsm:
raise ValueError(f"{use_rep} not found in adata.obsm. If you want to use adata.X, set use_rep=None")

Expand All @@ -115,7 +114,7 @@ def fit(self, adata: ad.AnnData, use_rep: str = "X_cellcharter"):

previous_stability = None
for i in range(self.max_runs):
print(f"Iteration {i+1}/{self.max_runs}")
print(f"Iteration {i + 1}/{self.max_runs}")
new_labels = {}

for k in tqdm(self.n_clusters, disable=(len(self.n_clusters) == 1)):
Expand Down Expand Up @@ -148,7 +147,7 @@ def fit(self, adata: ad.AnnData, use_rep: str = "X_cellcharter"):
for k, new_l in new_labels.items():
self.labels[k].append(new_l)
print(
f"Convergence with a change in stability of {stability_change} reached after {i+1} iterations"
f"Convergence with a change in stability of {stability_change} reached after {i + 1} iterations"
)
break

Expand Down
2 changes: 1 addition & 1 deletion src/cellcharter/tl/_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _remove_dangling_branches(graph, min_ratio=0.05):


def _longest_path_from_node(graph, u):
visited = {i: False for i in list(graph.nodes)}
visited = dict.fromkeys(graph.nodes)
distance = {i: -1 for i in list(graph.nodes)}
idx2node = dict(enumerate(graph.nodes))

Expand Down

0 comments on commit ce55415

Please sign in to comment.