diff --git a/armarx_memory/aron/aron_ice_types/__init__.py b/armarx_memory/aron/aron_ice_types/__init__.py index e5d93adfd7a9fb603e2be6c0c0b68d34fd122736..4bd40fbd40da29c159589cc3b566c0d56897e490 100644 --- a/armarx_memory/aron/aron_ice_types/__init__.py +++ b/armarx_memory/aron/aron_ice_types/__init__.py @@ -1,3 +1,3 @@ from .import_aron_slice import import_aron_slice -from .aron_ice_types import AronDataIceTypes +from .aron_ice_types import AronDataIceTypes, AronIceTypes from .aron_type_ice_types import AronTypeIceTypes diff --git a/armarx_memory/aron/aron_ice_types/aron_ice_types.py b/armarx_memory/aron/aron_ice_types/aron_ice_types.py index fa39e67bf8cac6b81ba357a077ad5235cb1182e6..12a23fcdecc61861f5d8305689cbec8bf803fd7a 100644 --- a/armarx_memory/aron/aron_ice_types/aron_ice_types.py +++ b/armarx_memory/aron/aron_ice_types/aron_ice_types.py @@ -3,6 +3,57 @@ from .import_aron_slice import import_aron_slice armarx_aron = import_aron_slice() data_dto = armarx_aron.data.dto +class AronIceTypes: + ARON_VERSION = armarx_aron.Version() + + Version = armarx_aron.Version + + Data = data_dto.GenericData + + String = data_dto.AronString + Bool = data_dto.AronBool + Int = data_dto.AronInt + Long = data_dto.AronLong + Float = data_dto.AronFloat + Double = data_dto.AronDouble + + List = data_dto.List + Dict = data_dto.Dict + + NDArray = data_dto.NDArray + + @classmethod + def string(cls, value: str) -> String: + return cls.String(value=value, VERSION=cls.ARON_VERSION) + + @classmethod + def bool(cls, value: int) -> Bool: + return cls.Bool(value=value, VERSION=cls.ARON_VERSION) + + @classmethod + def int(cls, value: int) -> Int: + return cls.Int(value=value, VERSION=cls.ARON_VERSION) + + @classmethod + def long(cls, value: int) -> Long: + return cls.Long(value=value, VERSION=cls.ARON_VERSION) + + @classmethod + def float(cls, value: float) -> Float: + return cls.Float(value=value, VERSION=cls.ARON_VERSION) + + @classmethod + def double(cls, value: float) -> Double: + return cls.Double(value=value, VERSION=cls.ARON_VERSION) + + @classmethod + def list(cls, elements: list) -> List: + return cls.List(elements=elements, VERSION=cls.ARON_VERSION) + + @classmethod + def dict(cls, elements: dict) -> Dict: + return cls.Dict(elements=elements, VERSION=cls.ARON_VERSION) + class AronDataIceTypes: ARON_VERSION = armarx_aron.Version() diff --git a/armarx_memory/aron/conversion/pythonic_from_to_aron_ice.py b/armarx_memory/aron/conversion/pythonic_from_to_aron_ice.py index f82bbc2aa923f6ed571d971ff3463729db8188c2..36e2eb31fd5c6c08dc7bc7255410398fbffc16a2 100644 --- a/armarx_memory/aron/conversion/pythonic_from_to_aron_ice.py +++ b/armarx_memory/aron/conversion/pythonic_from_to_aron_ice.py @@ -5,7 +5,7 @@ import numpy as np import typing as ty import armarx -from armarx_memory.aron.aron_ice_types import AronDataIceTypes +from armarx_memory.aron.aron_ice_types import AronDataIceTypes, AronIceTypes def pythonic_to_aron_ice( diff --git a/armarx_memory/client/Reader.py b/armarx_memory/client/Reader.py index 5f9eb89936ceb88ce70e0cfe8241f81620970e79..1397e7777a20b393a257f0ee5a6422e74536b333 100644 --- a/armarx_memory/client/Reader.py +++ b/armarx_memory/client/Reader.py @@ -257,8 +257,8 @@ class Reader: @classmethod def for_each_instance_data_ice( cls, - fn: ty.Callable[[dto.MemoryID, AronIceTypes.Dict], ty.Any] or - ty.Callable[[dto.MemoryID, dto.EntityInstanceMetadata, AronIceTypes.Dict], ty.Any], + fn: ty.Callable[[dto.MemoryID, AronDataIceTypes.Dict], ty.Any] or + ty.Callable[[dto.MemoryID, dto.EntityInstanceMetadata, AronDataIceTypes.Dict], ty.Any], data: ty.Union[ dto.Memory, dto.CoreSegment,