From be728c30f103e925664c269db49d93897b084748 Mon Sep 17 00:00:00 2001 From: Tilman Daab <tilman.daab@kit.edu> Date: Fri, 17 Jan 2025 18:12:36 +0100 Subject: [PATCH 1/2] undo __future__ import for type annotations, which is incompatible with python 3.6 --- armarx_memory/aron/common/framed/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/armarx_memory/aron/common/framed/__init__.py b/armarx_memory/aron/common/framed/__init__.py index 93d1c55d..86072f46 100644 --- a/armarx_memory/aron/common/framed/__init__.py +++ b/armarx_memory/aron/common/framed/__init__.py @@ -1,4 +1,6 @@ -from __future__ import annotations +# Using classes in the type annotations of their own methods can be re-introduced once this import is compatible +# (>= python 3.7) or native support is ready +# from __future__ import annotations import dataclasses as dc import numpy as np @@ -46,7 +48,7 @@ class FramedPose(AronDataclass): pose: np.ndarray = dc.field(default_factory=lambda: np.eye(4, dtype=np.float32)) @classmethod - def with_type_check(cls, header: FrameID, pose: np.ndarray) -> FramedPose: + def with_type_check(cls, header: FrameID, pose: np.ndarray) -> 'FramedPose': """ Ensures that the data type of the pose array is correct; otherwise, there might be problems when reading the memory from C++ -- GitLab From 7a19b9aea35154d8b3ae747cfa16394f104fdbfd Mon Sep 17 00:00:00 2001 From: Timo Birr <timo.birr@kit.edu> Date: Mon, 20 Jan 2025 18:39:03 +0100 Subject: [PATCH 2/2] Fixed syntax error --- armarx_core/time/duration.py | 2 +- armarx_memory/aron/common/framed/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/armarx_core/time/duration.py b/armarx_core/time/duration.py index 0b3a5f76..36efbdc0 100644 --- a/armarx_core/time/duration.py +++ b/armarx_core/time/duration.py @@ -13,7 +13,7 @@ MIN_LONG_CPP = -9223372036854775808 @dataclasses.dataclass class Duration(AronDataclass): - microSeconds: np.int64 = MIN_LONG_CPP, # std::numeric_limits<long>::min() + microSeconds: np.int64 = MIN_LONG_CPP # std::numeric_limits<long>::min() @staticmethod def from_seconds(seconds: float) -> "Duration": diff --git a/armarx_memory/aron/common/framed/__init__.py b/armarx_memory/aron/common/framed/__init__.py index 93d1c55d..30cd0008 100644 --- a/armarx_memory/aron/common/framed/__init__.py +++ b/armarx_memory/aron/common/framed/__init__.py @@ -1,4 +1,4 @@ -from __future__ import annotations +#from __future__ import annotations import dataclasses as dc import numpy as np -- GitLab