Skip to content

Commit

Permalink
style(pre-commit.ci): auto fixes [...]
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 2, 2024
1 parent 138af8c commit c8f835f
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 25 deletions.
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
1 change: 1 addition & 0 deletions tests/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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
3 changes: 1 addition & 2 deletions tests/metrics/test_ctc_metrics.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.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
Expand Down
3 changes: 1 addition & 2 deletions tests/metrics/test_divisions.py
Original file line number Diff line number Diff line change
@@ -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()
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 Matched, 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
@@ -1,6 +1,7 @@
import networkx as nx
import numpy as np
import skimage as sk

from traccuracy._tracking_graph import TrackingGraph


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

1 comment on commit c8f835f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Mean (s) BASE 4160403 Mean (s) HEAD c8f835f Percent Change
test_load_gt_data 1.19203 1.19805 0.51
test_load_pred_data 1.11932 1.14587 2.37
test_ctc_checks 0.40662 0.40647 -0.04
test_ctc_matched 1.7418 1.65219 -5.14
test_ctc_metrics 0.50715 0.50724 0.02
test_ctc_div_metrics 0.26006 0.25835 -0.66
test_iou_matched 1.70951 1.70503 -0.26
test_iou_div_metrics 0.26937 0.26424 -1.9

Please sign in to comment.