Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#747)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 24.8.0 → 24.10.0](psf/black@24.8.0...24.10.0)
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0)
- [github.com/asottile/pyupgrade: v3.17.0 → v3.18.0](asottile/pyupgrade@v3.17.0...v3.18.0)
- [github.com/asottile/blacken-docs: 1.18.0 → 1.19.0](adamchainz/blacken-docs@1.18.0...1.19.0)
- [github.com/astral-sh/ruff-pre-commit: v0.6.4 → v0.6.9](astral-sh/ruff-pre-commit@v0.6.4...v0.6.9)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test examples fix?

* fix, pin version

* fix graph?

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Arina Danilina <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and Arina Danilina authored Oct 16, 2024
1 parent f91b455 commit 1c07045
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ fail_fast: false
default_language_version:
python: python3
default_stages:
- commit
- push
- pre-commit
- pre-push
minimum_pre_commit_version: 3.0.0
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
Expand All @@ -13,7 +13,7 @@ repos:
additional_dependencies: [numpy>=1.25.0]
files: ^src
- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
additional_dependencies: [toml]
Expand All @@ -29,7 +29,7 @@ repos:
additional_dependencies: [toml]
args: [--order-by-type]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: check-ast
Expand All @@ -42,12 +42,12 @@ repos:
- id: check-yaml
- id: check-toml
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.18.0
hooks:
- id: pyupgrade
args: [--py3-plus, --py38-plus, --keep-runtime-typing]
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
rev: 1.19.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.1.0]
Expand All @@ -63,7 +63,7 @@ repos:
- id: doc8
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.4
rev: v0.6.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies = [
"numpy>=1.20.0",
"scipy>=1.7.0",
"pandas>=2.0.1",
"networkx>=2.6.3",
"networkx>=3.2",
# https://github.com/scverse/scanpy/issues/2411
"matplotlib>=3.5.0",
"anndata>=0.9.1",
Expand Down
2 changes: 1 addition & 1 deletion src/moscot/backends/ott/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def _prepare( # type: ignore[override]
) -> Tuple[MultiLoader, MultiLoader]:
train_loaders = []
validate_loaders = []
seed = kwargs.get("seed", None)
seed = kwargs.get("seed")
is_aligned = kwargs.get("is_aligned", False)
if train_size == 1.0:
for sample_pair in sample_pairs:
Expand Down
4 changes: 3 additions & 1 deletion src/moscot/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,9 @@ def _get_random_trees(
assert len(leaf_names[i]) == n_leaves
trees = []
for tree_idx in range(n_trees):
G = nx.random_tree(n_initial_nodes, seed=seed, create_using=nx.DiGraph)
tempG = nx.random_labeled_tree(n_initial_nodes, seed=seed)
G = nx.DiGraph()
G.add_edges_from(tempG.edges)
leaves = [x for x in G.nodes() if G.out_degree(x) == 0 and G.in_degree(x) == 1]
inner_nodes = list(set(G.nodes()) - set(leaves))
leaves_updated = leaves.copy()
Expand Down

0 comments on commit 1c07045

Please sign in to comment.