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 Feb 5, 2024
1 parent ba0c596 commit e3c751f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/traccuracy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""package description."""

from importlib.metadata import PackageNotFoundError, version

try:
Expand Down
4 changes: 2 additions & 2 deletions src/traccuracy/_tracking_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ def __init__(
self.nodes_by_frame[frame].add(node)
# store node id in nodes_by_flag mapping
for node_flag in NodeFlag:
if node_flag in attrs and attrs[node_flag]:
if attrs.get(node_flag):
self.nodes_by_flag[node_flag].add(node)

# store edge id in edges_by_flag
for edge, attrs in self.graph.edges.items():
for edge_flag in EdgeFlag:
if edge_flag in attrs and attrs[edge_flag]:
if attrs.get(edge_flag):
self.edges_by_flag[edge_flag].add(edge)

# Store first and last frames for reference
Expand Down
1 change: 1 addition & 0 deletions src/traccuracy/loaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Each loading function must return one TrackingGraph object which has a
track graph and optionally contains a corresponding segmentation.
"""

from ._ctc import _check_ctc, _get_node_attributes, _load_tiffs, load_ctc_data

__all__ = ["load_ctc_data", "_check_ctc", "_load_tiffs", "_get_node_attributes"]
1 change: 1 addition & 0 deletions src/traccuracy/matchers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
While we specify ground truth and prediction, it is possible to
write a matching function that matches two arbitrary tracking solutions.
"""

from ._base import Matched
from ._compute_overlap import get_labels_with_overlap
from ._ctc import CTCMatcher
Expand Down
1 change: 1 addition & 0 deletions src/traccuracy/matchers/_compute_overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Licensed under The MIT License [see LICENSE for details]
Copyright (c) 2015 Microsoft
"""

from typing import Tuple

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/traccuracy/metrics/_divisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
of the early division, by advancing along the graph to find nodes in the same frame
as the late division daughters.
"""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions src/traccuracy/metrics/_track_overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- TP is defined analogously, with T^g_j and T^p_j being swapped in the definition.
"""

from __future__ import annotations

from itertools import groupby, product
Expand Down

1 comment on commit e3c751f

@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 88752c4 Mean (s) HEAD e3c751f Percent Change
test_load_gt_data 1.22594 1.23135 0.44
test_load_pred_data 1.17329 1.13068 -3.63
test_ctc_checks 0.407 0.41863 2.86
test_ctc_matched 2.22557 2.23678 0.5
test_ctc_metrics 0.44082 0.4827 9.5
test_ctc_div_metrics 0.27169 0.27303 0.49
test_iou_matched 8.53645 8.49828 -0.45
test_iou_div_metrics 0.26245 0.26407 0.62

Please sign in to comment.