From 64ce286c12b6291f5147b6e51298713e1705c584 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 29 Mar 2024 16:37:48 -0400 Subject: [PATCH 1/3] use ruff-format, add Caroline --- .pre-commit-config.yaml | 10 +++------- pyproject.toml | 12 ++++++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b887df0..8c6aceb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,18 +5,14 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.0 + rev: v0.3.4 hooks: - id: ruff args: [--fix, --unsafe-fixes] - - - repo: https://github.com/psf/black - rev: 24.1.1 - hooks: - - id: black + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.9.0 hooks: - id: mypy files: "^motile/" diff --git a/pyproject.toml b/pyproject.toml index ca1d49a..8ef68a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ license = { text = "MIT" } authors = [ { name = 'Jan Funke', email = 'funkej@janelia.hhmi.org' }, { name = 'Talley Lambert', email = 'talley.lambert@gmail.com' }, + { name = 'Caroline Malin-Mayor', email = 'malinmayorc@janelia.hhmi.org' }, { name = 'Benjamin Gallusser', email = 'bgallusser@googlemail.com' }, { name = 'Florian Jug', email = 'florian.jug@fht.org' }, ] @@ -44,6 +45,9 @@ path = "motile/__init__.py" [tool.ruff] target-version = "py38" src = ["motile"] + +[tool.ruff.lint] +pydocstyle = { convention = "google" } select = [ "F", # pyflakes "E", # pycodestyle @@ -57,14 +61,10 @@ ignore = [ "D104", # Missing docstring in public package "D105", # Missing docstring in magic method "D107", # Missing docstring in `__init__` - "D102", # Missing docstring in public method - # "D205", # 1 blank line required between summary line and description - ] -[tool.ruff.pydocstyle] -convention = "google" -[tool.ruff.per-file-ignores] + +[tool.ruff.lint.per-file-ignores] "tests/*" = ["D"] # https://docs.pytest.org/en/6.2.x/customize.html From 1736a826fa241339c8d2af51134e2a1ecc3b1757 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:24:49 +0000 Subject: [PATCH 2/3] style(pre-commit.ci): auto fixes [...] --- motile/costs/edge_distance.py | 1 - tests/test_constraints.py | 1 - 2 files changed, 2 deletions(-) diff --git a/motile/costs/edge_distance.py b/motile/costs/edge_distance.py index ac5edc4..2b83be6 100644 --- a/motile/costs/edge_distance.py +++ b/motile/costs/edge_distance.py @@ -55,7 +55,6 @@ def apply(self, solver: Solver) -> None: solver.add_variable_cost(index, 1.0, self.constant) def __get_node_position(self, graph: nx.DiGraph, node: int) -> np.ndarray: - if isinstance(self.position_attribute, tuple): return np.array([graph.nodes[node][p] for p in self.position_attribute]) else: diff --git a/tests/test_constraints.py b/tests/test_constraints.py index 8920bf4..c967bd7 100644 --- a/tests/test_constraints.py +++ b/tests/test_constraints.py @@ -67,7 +67,6 @@ def test_max_parents(solver: motile.Solver) -> None: def test_exlusive_nodes(solver: motile.Solver) -> None: - exclusive_sets = [ [0, 1], [2, 3], From b11d0ef486c0a2919cf7293bf8f2893077dff9c8 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 30 Apr 2024 11:25:55 -0400 Subject: [PATCH 3/3] update ruff --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd520e8..1a09854 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,14 +5,14 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.5 + rev: v0.4.2 hooks: - id: ruff args: [--fix, --unsafe-fixes] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 + rev: v1.10.0 hooks: - id: mypy files: "^motile/"