Skip to content

Commit

Permalink
Clean up type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderFabisch committed Jul 20, 2023
1 parent 9c74446 commit 98031a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def __init__(self, strict_check=True, check=True):
self._current_time = 0.0

@property
def current_time(self) -> float:
def current_time(self):
"""Current time at which we evaluate transformations."""
return self._current_time

@current_time.setter
def current_time(self, time: float):
def current_time(self, time):
"""Set current time at which we evaluate transformations."""
self._current_time = time

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class TimeVaryingTransform(abc.ABC):

class TemporalTransformManager(TransformGraphBase):
_transforms: Dict[Tuple[Hashable, Hashable], TimeVaryingTransform]
_current_time: float

def __init__(self, strict_check: bool = ...,
check: bool = ...) -> "TemporalTransformManager": ...
Expand All @@ -28,7 +29,11 @@ class TemporalTransformManager(TransformGraphBase):
@property
def current_time(self) -> float: ...

def _check_transform(self, A2B: npt.ArrayLike) -> np.ndarray: ...
@current_time.setter
def current_time(self, time: float): ...

def _check_transform(
self, A2B: TimeVaryingTransform) -> TimeVaryingTransform: ...

def _transform_available(self, key: Tuple[Hashable, Hashable]) -> bool: ...

Expand Down
4 changes: 2 additions & 2 deletions pytransform3d/transform_manager/_transform_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def transforms(self):
"""Rigid transformations between nodes."""
return self._transforms

def _check_transform(self, A2B_matrix):
def _check_transform(self, A2B):
"""Check validity of rigid transformation."""
return check_transform(A2B_matrix, strict_check=self.strict_check)
return check_transform(A2B, strict_check=self.strict_check)

def _transform_available(self, key):
return key in self._transforms
Expand Down

0 comments on commit 98031a2

Please sign in to comment.