You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong annotation in ConfigModel for controlsystem #31
There is a bug in the ConfigModel for the controlsystem. It says debug_level: str = None which needs to be debug_level: str | None = None or Pydantic will give a validation error when None is given.
I can fix it myself, but the docstring says it should be an int. So is the docstring also wrong or the model should actually have int and not str? @gupichon which is correct?
class ConfigModel(BaseModel):
"""
Configuration model for a Tango Control System.
Attributes
----------
name : str
Name of the control system.
tango_host : str
Tango host URL. Default is the TANGO_HOST variable.
debug_level : int
Debug verbosity level.
scalar_aggregator : str
Aggregator module for scalar values. If none specified, writings and readings of sclar value are serialized.
vector_aggregator : str
Aggregator module for vecrors. If none specified, writings and readings of vector are serialized.
timeout_ms : int
Device timeout in milli seconds.
"""
name: str
tango_host: str | None = None
debug_level: str = None
lazy_devices: bool = True
scalar_aggregator: str | None = "tango.pyaml.multi_attribute"
vector_aggregator: str | None = None
timeout_ms: int = 3000
Actually, it is used to set the log level for the Python logging library, so it accepts both integers and strings. I have made the correction and updated the documentation accordingly.
Activity
gupichon commentedon May 19, 2026
Actually, it is used to set the log level for the Python logging library, so it accepts both integers and strings. I have made the correction and updated the documentation accordingly.