Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jul 7, 2024
1 parent eff659e commit 8651925
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/useq/_position.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
from typing import (
TYPE_CHECKING,
ClassVar,
Generic,
Iterator,
Literal,
Optional,
SupportsIndex,
TypeVar,
)
from typing import TYPE_CHECKING, Generic, Iterator, Optional, SupportsIndex, TypeVar

from pydantic import Field

Expand Down Expand Up @@ -110,7 +101,7 @@ def num_positions(self) -> int:
raise NotImplementedError("This method must be implemented by subclasses.")


class RelativePosition(PositionBase, _MultiPointPlan):
class RelativePosition(PositionBase, _MultiPointPlan["RelativePosition"]):
"""A relative position in 3D space.
Relative positions also support `fov_width` and `fov_height` attributes, and can
Expand All @@ -120,7 +111,10 @@ class RelativePosition(PositionBase, _MultiPointPlan):
x: float = 0
y: float = 0
z: float = 0
is_relative: ClassVar[Literal[True]] = True

@property
def is_relative(self) -> bool:
return True

def __iter__(self) -> Iterator["RelativePosition"]: # type: ignore [override]
yield self
Expand Down

0 comments on commit 8651925

Please sign in to comment.