Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/funtracks/data_model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
from .tracks import Tracks # noqa
from .solution_tracks import SolutionTracks # noqa
from .tracks_controller import TracksController # noqa
from .graph_attributes import NodeType, NodeAttr, EdgeAttr # noqa
87 changes: 0 additions & 87 deletions src/funtracks/data_model/graph_attributes.py

This file was deleted.

57 changes: 0 additions & 57 deletions src/funtracks/data_model/solution_tracks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import warnings
from typing import TYPE_CHECKING

import networkx as nx
Expand All @@ -11,8 +10,6 @@
from .tracks import Tracks

if TYPE_CHECKING:
from pathlib import Path

from funtracks.annotators import TrackAnnotator

from .tracks import Node
Expand Down Expand Up @@ -74,21 +71,6 @@ def __init__(

self.track_annotator = self._get_track_annotator()

def _initialize_track_ids(self) -> None:
"""Initialize track IDs for all nodes.

Deprecated:
This method is deprecated and will be removed in funtracks v2.0.
Track IDs are now auto-computed during SolutionTracks initialization.
"""
warnings.warn(
"`_initialize_track_ids` is deprecated and will be removed in funtracks v2.0."
" Track IDs are now auto-computed during SolutionTracks initialization.",
DeprecationWarning,
stacklevel=2,
)
self.enable_features([self.features.tracklet_key]) # type: ignore

def _get_track_annotator(self) -> TrackAnnotator:
"""Get the TrackAnnotator instance from the annotator registry.

Expand Down Expand Up @@ -136,16 +118,6 @@ def max_track_id(self) -> int:
def track_id_to_node(self) -> dict[int, list[int]]:
return self.track_annotator.tracklet_id_to_nodes

@property
def node_id_to_track_id(self) -> dict[Node, int]:
warnings.warn(
"node_id_to_track_id property will be removed in funtracks v2. "
"Use `get_track_id` instead for better performance.",
DeprecationWarning,
stacklevel=2,
)
return nx.get_node_attributes(self.graph, self.features.tracklet_key)

def get_next_track_id(self) -> int:
"""Return the next available track_id and update max_tracklet_id in TrackAnnotator

Expand All @@ -162,35 +134,6 @@ def get_track_id(self, node) -> int:
track_id = self.get_node_attr(node, self.features.tracklet_key, required=True)
return track_id

def export_tracks(
self, outfile: Path | str, node_ids: set[int] | None = None
) -> None:
"""Export the tracks from this run to a csv with the following columns:
t,[z],y,x,id,parent_id,track_id
Cells without a parent_id will have an empty string for the parent_id.
Whether or not to include z is inferred from self.ndim

Args:
outfile (Path): path to output csv file
node_ids (set[int], optional): nodes to be included. If provided, only these
nodes and their ancestors will be included in the output.

.. deprecated:: 1.0
`SolutionTracks.export_tracks()` is deprecated and will be removed in v2.0.
Use :func:`funtracks.import_export.export_to_csv` instead.
"""
warnings.warn(
"SolutionTracks.export_tracks() is deprecated and will be removed in v2.0. "
"Use funtracks.import_export.export_to_csv() instead.",
DeprecationWarning,
stacklevel=2,
)

# Import here to avoid circular imports
from funtracks.import_export.csv._export import export_to_csv

export_to_csv(self, outfile, node_ids)

def get_track_neighbors(
self, track_id: int, time: int
) -> tuple[Node | None, Node | None]:
Expand Down
Loading