From 45a42a677d5670832b02547389c20483ec76af67 Mon Sep 17 00:00:00 2001 From: PONS Date: Mon, 9 Feb 2026 07:09:47 +0100 Subject: [PATCH 1/2] Extracted devices and arrays for Accelerator repr --- pyaml/accelerator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyaml/accelerator.py b/pyaml/accelerator.py index 0300f354..00181068 100644 --- a/pyaml/accelerator.py +++ b/pyaml/accelerator.py @@ -4,7 +4,7 @@ import os -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field from .arrays.array import ArrayConfig from .common.element import Element @@ -55,8 +55,8 @@ class ConfigModel(BaseModel): simulators: list[Simulator] = None data_folder: str description: str | None = None - arrays: list[ArrayConfig] = None - devices: list[Element] + arrays: list[ArrayConfig] = Field(default=None, repr=False) + devices: list[Element] = Field(repr=False) class Accelerator(object): From befd49b34a2d4bcb6e44ae5d5eb233f11406b6e0 Mon Sep 17 00:00:00 2001 From: PONS Date: Mon, 9 Feb 2026 07:10:09 +0100 Subject: [PATCH 2/2] Added missing repr --- pyaml/arrays/array.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyaml/arrays/array.py b/pyaml/arrays/array.py index c464a9ba..7efa621b 100644 --- a/pyaml/arrays/array.py +++ b/pyaml/arrays/array.py @@ -37,3 +37,8 @@ def __init__(self, cfg: ArrayConfigModel): def fill_array(self, holder: ElementHolder): raise PyAMLException("Array.fill_array() is not subclassed") + + def __repr__(self): + # ArrayConfigModel is a super class + # ConfigModel is expected from sub classes + return repr(self._cfg).replace("ConfigModel", self.__class__.__name__)