funtracks.actions.add_delete_edge
AddEdge
AddEdge(
tracks: Tracks,
edge: Edge,
attributes: dict[str, Any] | None = None,
)
Bases: BasicAction
Action for adding a new edge. Endpoints must exist already.
Create an action to add a new edge, with optional attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tracks
|
Tracks
|
The Tracks to add the edge to |
required |
edge
|
Edge
|
The edge to add (source, target) |
required |
attributes
|
dict[str, Any] | None
|
Edge attributes to set. If any computed features are provided, they will be overridden by the Annotator. Defaults to None. |
None
|
inverse
inverse() -> BasicAction
Delete edges
DeleteEdge
DeleteEdge(tracks: Tracks, edge: Edge)
Bases: BasicAction
Action for deleting an edge. Edge must exist already.
Action for deleting an edge. Edge must exist already.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tracks
|
Tracks
|
The tracks to delete the edge from |
required |
edge
|
Edge
|
The edge to delete |
required |
Raises: ValueError: If the edge does not exist on the graph
inverse
inverse() -> BasicAction
Restore edge and their attributes