Skip to content

Commit

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

updates:
- [github.com/crate-ci/typos: v1.23.6 → typos-dict-v0.11.37](crate-ci/typos@v1.23.6...typos-dict-v0.11.37)
- [github.com/astral-sh/ruff-pre-commit: v0.5.6 → v0.8.1](astral-sh/ruff-pre-commit@v0.5.6...v0.8.1)
- [github.com/psf/black: 24.8.0 → 24.10.0](psf/black@24.8.0...24.10.0)
- [github.com/abravalheri/validate-pyproject: v0.18 → v0.23](abravalheri/validate-pyproject@v0.18...v0.23)
- [github.com/pre-commit/mirrors-mypy: v1.11.1 → v1.13.0](pre-commit/mirrors-mypy@v1.11.1...v1.13.0)

* style(pre-commit.ci): auto fixes [...]

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Dec 3, 2024
1 parent a78b48c commit f0584ed
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 34 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ ci:

repos:
- repo: https://github.com/crate-ci/typos
rev: v1.23.6
rev: typos-dict-v0.11.37
hooks:
- id: typos

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.8.1
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
rev: v0.23
hooks:
- id: validate-pyproject

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
rev: v1.13.0
hooks:
- id: mypy
files: "^src/"
Expand Down
17 changes: 8 additions & 9 deletions examples/ctc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"outputs": [],
"source": [
"import os\n",
"from pathlib import Path\n",
"import pprint\n",
"import urllib.request\n",
"import zipfile\n",
Expand Down Expand Up @@ -101,7 +100,7 @@
" name='Hela-01_GT'\n",
")\n",
"pred_data = load_ctc_data(\n",
" 'sample-data/Fluo-N2DL-HeLa/01_RES', \n",
" 'sample-data/Fluo-N2DL-HeLa/01_RES',\n",
" 'sample-data/Fluo-N2DL-HeLa/01_RES/res_track.txt',\n",
" name='Hela-01_RES'\n",
")"
Expand Down Expand Up @@ -181,9 +180,9 @@
],
"source": [
"ctc_results = run_metrics(\n",
" gt_data=gt_data, \n",
" pred_data=pred_data, \n",
" matcher=CTCMatcher(), \n",
" gt_data=gt_data,\n",
" pred_data=pred_data,\n",
" matcher=CTCMatcher(),\n",
" metrics=[CTCMetrics(), DivisionMetrics(frame_buffer=(0,1,2))],\n",
")\n",
"pp.pprint(ctc_results)"
Expand Down Expand Up @@ -244,10 +243,10 @@
],
"source": [
"iou_results = run_metrics(\n",
" gt_data=gt_data, \n",
" pred_data=pred_data, \n",
" matcher=IOUMatcher(iou_threshold=0.1), \n",
" metrics=[DivisionMetrics(frame_buffer=(0,1,2))], \n",
" gt_data=gt_data,\n",
" pred_data=pred_data,\n",
" matcher=IOUMatcher(iou_threshold=0.1),\n",
" metrics=[DivisionMetrics(frame_buffer=(0,1,2))],\n",
")\n",
"pp.pprint(iou_results)"
]
Expand Down
2 changes: 1 addition & 1 deletion src/traccuracy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
from ._run_metrics import run_metrics
from ._tracking_graph import EdgeFlag, NodeFlag, TrackingGraph

__all__ = ["TrackingGraph", "run_metrics", "NodeFlag", "EdgeFlag"]
__all__ = ["EdgeFlag", "NodeFlag", "TrackingGraph", "run_metrics"]
2 changes: 1 addition & 1 deletion src/traccuracy/loaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

from ._ctc import _check_ctc, _get_node_attributes, _load_tiffs, load_ctc_data

__all__ = ["load_ctc_data", "_check_ctc", "_load_tiffs", "_get_node_attributes"]
__all__ = ["_check_ctc", "_get_node_attributes", "_load_tiffs", "load_ctc_data"]
2 changes: 1 addition & 1 deletion src/traccuracy/matchers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
from ._ctc import CTCMatcher
from ._iou import IOUMatcher

__all__ = ["CTCMatcher", "IOUMatcher", "get_labels_with_overlap", "Matched"]
__all__ = ["CTCMatcher", "IOUMatcher", "Matched", "get_labels_with_overlap"]
2 changes: 1 addition & 1 deletion src/traccuracy/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from ._divisions import DivisionMetrics
from ._track_overlap import TrackOverlapMetrics

__all__ = ["CTCMetrics", "DivisionMetrics", "AOGMMetrics", "TrackOverlapMetrics"]
__all__ = ["AOGMMetrics", "CTCMetrics", "DivisionMetrics", "TrackOverlapMetrics"]
1 change: 1 addition & 0 deletions tests/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pandas as pd
import pytest

from traccuracy.loaders import (
_check_ctc,
_get_node_attributes,
Expand Down
1 change: 1 addition & 0 deletions tests/loaders/test_ctc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

import pandas as pd

from traccuracy._tracking_graph import TrackingGraph
from traccuracy.loaders import _ctc

Expand Down
3 changes: 1 addition & 2 deletions tests/matchers/test_base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from tests.test_utils import get_movie_with_graph
from traccuracy._tracking_graph import TrackingGraph
from traccuracy.matchers._base import Matched, Matcher

from tests.test_utils import get_movie_with_graph


class DummyMatcher(Matcher):
def _compute_mapping(
Expand Down
4 changes: 2 additions & 2 deletions tests/matchers/test_compute_overlap.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest

from tests.test_utils import get_annotated_image
from traccuracy.matchers._compute_overlap import (
get_labels_with_overlap,
)

from tests.test_utils import get_annotated_image


@pytest.mark.parametrize("overlap", ["iou", "iogt"])
def test_get_labels_with_overlap(overlap):
Expand Down
4 changes: 2 additions & 2 deletions tests/matchers/test_ctc.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import networkx as nx
import numpy as np
import pytest
from traccuracy._tracking_graph import TrackingGraph
from traccuracy.matchers._ctc import CTCMatcher

from tests.test_utils import get_annotated_movie
from traccuracy._tracking_graph import TrackingGraph
from traccuracy.matchers._ctc import CTCMatcher


def test_match_ctc():
Expand Down
4 changes: 2 additions & 2 deletions tests/matchers/test_iou.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import networkx as nx
import numpy as np
import pytest

from tests.test_utils import get_annotated_image, get_movie_with_graph
from traccuracy._tracking_graph import TrackingGraph
from traccuracy.matchers._iou import (
IOUMatcher,
Expand All @@ -9,8 +11,6 @@
match_iou,
)

from tests.test_utils import get_annotated_image, get_movie_with_graph


def get_two_to_one(w, h, imw, imh):
"""Basic two cell merge/split
Expand Down
4 changes: 2 additions & 2 deletions tests/metrics/test_ctc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from pathlib import Path

import pytest

from tests.test_utils import get_movie_with_graph, gt_data
from traccuracy.loaders import load_ctc_data
from traccuracy.matchers import CTCMatcher
from traccuracy.metrics import CTCMetrics

from tests.test_utils import get_movie_with_graph, gt_data

ROOT_DIR = Path(__file__).resolve().parents[2]


Expand Down
4 changes: 2 additions & 2 deletions tests/metrics/test_divisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from pathlib import Path

import pytest

from tests.test_utils import download_gt_data, get_division_graphs
from traccuracy import TrackingGraph
from traccuracy.loaders import load_ctc_data
from traccuracy.matchers import IOUMatcher, Matched
from traccuracy.metrics._divisions import DivisionMetrics

from tests.test_utils import download_gt_data, get_division_graphs

ROOT_DIR = Path(__file__).resolve().parents[2]


Expand Down
1 change: 1 addition & 0 deletions tests/metrics/test_track_overlap_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import networkx as nx
import pytest

from traccuracy import TrackingGraph
from traccuracy.matchers import Matched
from traccuracy.metrics._track_overlap import TrackOverlapMetrics, _mapping_to_dict
Expand Down
1 change: 1 addition & 0 deletions tests/metrics/test_weighted_error_sums.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from traccuracy.metrics._ctc import (
get_weighted_edge_error_sum,
get_weighted_error_sum,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_run_metrics.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest

from tests.test_utils import get_movie_with_graph
from traccuracy import run_metrics
from traccuracy.matchers._base import Matcher
from traccuracy.metrics._base import Metric

from tests.test_utils import get_movie_with_graph


class DummyMetric(Metric):
def _compute(self, matched):
Expand Down
1 change: 1 addition & 0 deletions tests/test_tracking_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import networkx as nx
import pytest

from traccuracy import EdgeFlag, NodeFlag, TrackingGraph


Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import networkx as nx
import numpy as np
import skimage as sk

from traccuracy._tracking_graph import TrackingGraph
from traccuracy.loaders import load_ctc_data

Expand Down
1 change: 1 addition & 0 deletions tests/track_errors/test_ctc_errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import networkx as nx
import numpy as np

from traccuracy._tracking_graph import EdgeFlag, NodeFlag, TrackingGraph
from traccuracy.matchers import Matched
from traccuracy.track_errors._ctc import get_edge_errors, get_vertex_errors
Expand Down
4 changes: 2 additions & 2 deletions tests/track_errors/test_divisions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import networkx as nx
import numpy as np
import pytest

from tests.test_utils import get_division_graphs
from traccuracy import NodeFlag, TrackingGraph
from traccuracy.matchers import Matched
from traccuracy.track_errors.divisions import (
Expand All @@ -11,8 +13,6 @@
_get_succ_by_t,
)

from tests.test_utils import get_division_graphs


@pytest.fixture
def g():
Expand Down

0 comments on commit f0584ed

Please sign in to comment.