diff --git a/src/ansys/acp/core/_tree_objects/_grpc_helpers/edge_property_list.py b/src/ansys/acp/core/_tree_objects/_grpc_helpers/edge_property_list.py index ea1b8c55b7..46a798b780 100644 --- a/src/ansys/acp/core/_tree_objects/_grpc_helpers/edge_property_list.py +++ b/src/ansys/acp/core/_tree_objects/_grpc_helpers/edge_property_list.py @@ -279,8 +279,10 @@ def __eq__(self, other: Any) -> Any: return list(self) == other def __repr__(self) -> str: - entries = ", ".join(f"{item}" for item in self._object_list) - return f"{self._parent_object.name} - {self._name}({entries})" + return ( + f"<{self.__class__.__name__}[{self._object_type.__name__}] " + + f"with parent {self._parent_object!r}, entries {self._object_list!r}>" + ) def define_edge_property_list( diff --git a/src/ansys/acp/core/_tree_objects/_grpc_helpers/linked_object_list.py b/src/ansys/acp/core/_tree_objects/_grpc_helpers/linked_object_list.py index ba7a2391df..d39e9950a6 100644 --- a/src/ansys/acp/core/_tree_objects/_grpc_helpers/linked_object_list.py +++ b/src/ansys/acp/core/_tree_objects/_grpc_helpers/linked_object_list.py @@ -214,6 +214,9 @@ def sort( def __eq__(self, other: Any) -> Any: return list(self) == other + def __repr__(self) -> str: + return f"" + ChildT = TypeVar("ChildT", bound=CreatableTreeObject) diff --git a/src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py b/src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py index 70f3645e25..955a97764d 100644 --- a/src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py +++ b/src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py @@ -107,6 +107,16 @@ def get(self, key: str, default: ValueT | None = None) -> ValueT | None: except KeyError: return default + def __repr__(self) -> str: + try: + from ..object_registry import object_registry + + collection_label = self._collection_path.value.rsplit("/", 1)[-1] + value_type = object_registry[collection_label] + return f"<{self.__class__.__name__}[{value_type.__name__}] with keys {list(self)}>" + except: + return super().__repr__() + class MutableMapping(Mapping[CreatableValueT]): """Mutable mapping interface for collections of TreeObjects."""