Skip to content

Commit

Permalink
Small fixes to typing
Browse files Browse the repository at this point in the history
  • Loading branch information
JuhoErvasti committed Oct 21, 2024
1 parent c8d23a2 commit b3dab2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fvh3t/core/trajectory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Tuple, NamedTuple
from typing import NamedTuple

from qgis.core import QgsGeometry, QgsPointXY, QgsVectorLayer, QgsWkbTypes

Expand All @@ -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])
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)]))

0 comments on commit b3dab2b

Please sign in to comment.