diff --git a/slic/core/acquisition/detcfg.py b/slic/core/acquisition/detcfg.py index 912a5f62..1241c4e7 100644 --- a/slic/core/acquisition/detcfg.py +++ b/slic/core/acquisition/detcfg.py @@ -4,6 +4,8 @@ from collections.abc import Mapping from collections.abc import Sequence from numbers import Number +from slic.utils.printing import printable_dict_of_dicts, printable_dict + from .broker_client import flatten_detectors #TODO: should probably move here @@ -105,6 +107,10 @@ class DetectorConfig(DictUpdateMixin, dict): value = DetectorParams(**value) super().__setitem__(key, value) + def __repr__(self): + return printable_dict_of_dicts(self) + + class DetectorParams(DictUpdateMixin, AttrDict): @@ -115,6 +121,10 @@ class DetectorParams(DictUpdateMixin, AttrDict): check_consistency(key, value) super().__setitem__(key, value) + def __repr__(self): + return printable_dict(self) + + def check_consistency(k, v): if k not in ALLOWED_PARAMS: