Skip to content

SimulationArgs.__post_init_ missing trailing underscore: dataclass hook never fires, defaults and validation silently skipped #211

Description

@craigpnnl

SimulationArgs in gridappsd-python-lib/gridappsd/simulation.py defines a method named __post_init_ (single trailing underscore). The dataclass post-init hook is __post_init__ (double trailing underscore). Because of the typo the method is never invoked by the dataclass machinery, so the intended default-filling logic and the publish_period/interval validation inside it have silently never run. Discovered while fixing the int|None typing for #208 (the fields behave as int|None at runtime precisely because the post-init that would fill/validate them never fires). Likely relevant to the PUBLISH_PERIOD/INTERVAL params added by the timestep work. Fix: rename to post_init, then verify the now-active default-filling and validation do not break existing callers (they pass explicit ints today). Found 2026-07-17.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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