From c8f835ff431aa36ea96ed2deea7f856843965122 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 21:54:19 +0000 Subject: [PATCH] style(pre-commit.ci): auto fixes [...] --- examples/ctc.ipynb | 17 ++++++++--------- tests/bench.py | 1 + tests/loaders/test_ctc.py | 1 + tests/matchers/test_base.py | 3 +-- tests/matchers/test_compute_overlap.py | 4 ++-- tests/matchers/test_ctc.py | 4 ++-- tests/matchers/test_iou.py | 4 ++-- tests/metrics/test_ctc_metrics.py | 3 +-- tests/metrics/test_divisions.py | 3 +-- tests/metrics/test_track_overlap_metrics.py | 1 + tests/metrics/test_weighted_error_sums.py | 1 + tests/test_run_metrics.py | 4 ++-- tests/test_tracking_graph.py | 1 + tests/test_utils.py | 1 + tests/track_errors/test_ctc_errors.py | 1 + tests/track_errors/test_divisions.py | 4 ++-- 16 files changed, 28 insertions(+), 25 deletions(-) diff --git a/examples/ctc.ipynb b/examples/ctc.ipynb index 2880881f..0c0995ad 100644 --- a/examples/ctc.ipynb +++ b/examples/ctc.ipynb @@ -15,7 +15,6 @@ "outputs": [], "source": [ "import os\n", - "from pathlib import Path\n", "import pprint\n", "import urllib.request\n", "import zipfile\n", @@ -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", ")" @@ -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)" @@ -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)" ] diff --git a/tests/bench.py b/tests/bench.py index 7b30bc51..c1186594 100644 --- a/tests/bench.py +++ b/tests/bench.py @@ -5,6 +5,7 @@ import pandas as pd import pytest + from traccuracy.loaders import ( _check_ctc, _get_node_attributes, diff --git a/tests/loaders/test_ctc.py b/tests/loaders/test_ctc.py index 38dcc06f..1796af6e 100644 --- a/tests/loaders/test_ctc.py +++ b/tests/loaders/test_ctc.py @@ -1,6 +1,7 @@ import os import pandas as pd + from traccuracy._tracking_graph import TrackingGraph from traccuracy.loaders import _ctc diff --git a/tests/matchers/test_base.py b/tests/matchers/test_base.py index 77cb47f7..1b50d936 100644 --- a/tests/matchers/test_base.py +++ b/tests/matchers/test_base.py @@ -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( diff --git a/tests/matchers/test_compute_overlap.py b/tests/matchers/test_compute_overlap.py index 78d5a530..0912d2f6 100644 --- a/tests/matchers/test_compute_overlap.py +++ b/tests/matchers/test_compute_overlap.py @@ -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): diff --git a/tests/matchers/test_ctc.py b/tests/matchers/test_ctc.py index e210d79c..cb1495e7 100644 --- a/tests/matchers/test_ctc.py +++ b/tests/matchers/test_ctc.py @@ -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(): diff --git a/tests/matchers/test_iou.py b/tests/matchers/test_iou.py index 38d10d0f..1c8fd4ff 100644 --- a/tests/matchers/test_iou.py +++ b/tests/matchers/test_iou.py @@ -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, @@ -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 diff --git a/tests/metrics/test_ctc_metrics.py b/tests/metrics/test_ctc_metrics.py index 2bf18a5e..3f3ee25c 100644 --- a/tests/metrics/test_ctc_metrics.py +++ b/tests/metrics/test_ctc_metrics.py @@ -1,8 +1,7 @@ +from tests.test_utils import get_movie_with_graph from traccuracy.matchers._ctc import CTCMatcher from traccuracy.metrics._ctc import CTCMetrics -from tests.test_utils import get_movie_with_graph - def test_compute_mapping(): # Test 2d data diff --git a/tests/metrics/test_divisions.py b/tests/metrics/test_divisions.py index ce2d978c..5eb0478f 100644 --- a/tests/metrics/test_divisions.py +++ b/tests/metrics/test_divisions.py @@ -1,9 +1,8 @@ +from tests.test_utils import get_division_graphs from traccuracy import TrackingGraph from traccuracy.matchers import Matched from traccuracy.metrics._divisions import DivisionMetrics -from tests.test_utils import get_division_graphs - def test_DivisionMetrics(): g_gt, g_pred, mapper = get_division_graphs() diff --git a/tests/metrics/test_track_overlap_metrics.py b/tests/metrics/test_track_overlap_metrics.py index e6fb2bb8..da509ed3 100644 --- a/tests/metrics/test_track_overlap_metrics.py +++ b/tests/metrics/test_track_overlap_metrics.py @@ -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 diff --git a/tests/metrics/test_weighted_error_sums.py b/tests/metrics/test_weighted_error_sums.py index 4da44e48..c4ae5a6a 100644 --- a/tests/metrics/test_weighted_error_sums.py +++ b/tests/metrics/test_weighted_error_sums.py @@ -1,4 +1,5 @@ import pytest + from traccuracy.metrics._ctc import ( get_weighted_edge_error_sum, get_weighted_error_sum, diff --git a/tests/test_run_metrics.py b/tests/test_run_metrics.py index b3962257..b0dfe421 100644 --- a/tests/test_run_metrics.py +++ b/tests/test_run_metrics.py @@ -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 Matched, Matcher from traccuracy.metrics._base import Metric -from tests.test_utils import get_movie_with_graph - class DummyMetric(Metric): def _compute(self, matched): diff --git a/tests/test_tracking_graph.py b/tests/test_tracking_graph.py index 02739070..9c4a79e4 100644 --- a/tests/test_tracking_graph.py +++ b/tests/test_tracking_graph.py @@ -2,6 +2,7 @@ import networkx as nx import pytest + from traccuracy import EdgeFlag, NodeFlag, TrackingGraph diff --git a/tests/test_utils.py b/tests/test_utils.py index 6f854ad1..6678eb53 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,7 @@ import networkx as nx import numpy as np import skimage as sk + from traccuracy._tracking_graph import TrackingGraph diff --git a/tests/track_errors/test_ctc_errors.py b/tests/track_errors/test_ctc_errors.py index 323fc4a3..32422ba2 100644 --- a/tests/track_errors/test_ctc_errors.py +++ b/tests/track_errors/test_ctc_errors.py @@ -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 diff --git a/tests/track_errors/test_divisions.py b/tests/track_errors/test_divisions.py index bb59bf0e..fd974a35 100644 --- a/tests/track_errors/test_divisions.py +++ b/tests/track_errors/test_divisions.py @@ -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 ( @@ -11,8 +13,6 @@ _get_succ_by_t, ) -from tests.test_utils import get_division_graphs - @pytest.fixture def g():