Skip to content

Wrong annotation in ConfigModel for controlsystem #31

Closed

Description

@TeresiaOlsson

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

Activity

  1. self-assigned this
    on May 19, 2026
  2. gupichon commented on May 19, 2026

    @gupichon
    Member

    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.

  3. linked a pull request that will close this issueAnnotation correction for logging level #32on May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions