diff --git a/fvh3t/core/trajectory.py b/fvh3t/core/trajectory.py index 87c7b1a..54e6825 100644 --- a/fvh3t/core/trajectory.py +++ b/fvh3t/core/trajectory.py @@ -1,4 +1,4 @@ -from typing import Tuple, NamedTuple +from typing import NamedTuple from qgis.core import QgsGeometry, QgsPointXY, QgsVectorLayer, QgsWkbTypes @@ -24,8 +24,8 @@ class Trajectory: of nodes which have a location and a timestamp """ - def __init__(self, nodes: Tuple[TrajectoryNode]) -> None: - self.__nodes: Tuple[TrajectoryNode] = nodes + def __init__(self, nodes: tuple[TrajectoryNode, ...]) -> None: + self.__nodes: tuple[TrajectoryNode, ...] = nodes def as_geometry(self) -> QgsGeometry: return QgsGeometry.fromPolylineXY([node.point for node in self.__nodes]) diff --git a/tests/conftest.py b/tests/conftest.py index a607750..09a726b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,6 +15,7 @@ """ import pytest +from fvh3t.core.gate import Gate from fvh3t.core.trajectory import Trajectory, TrajectoryNode from qgis.core import QgsGeometry, QgsPointXY @@ -25,4 +26,4 @@ def two_node_trajectory(): @pytest.fixture def two_point_gate(): - return QgsGeometry.fromPolylineXY([QgsPointXY(-0.5, 0.5), QgsPointXY(0.5, 0.5)]) + return Gate(QgsGeometry.fromPolylineXY([QgsPointXY(-0.5, 0.5), QgsPointXY(0.5, 0.5)]))