Skip to content

run_simulation takes 15 positional parameters and 9 config dataclasses from one file, with no runtime schema — every caller is welded to the core's shape #5

Description

@dim-sous

What is wrong

core/simulator/core.py:54-69:

def run_simulation(strategy, forecast_e, forecast_r, probabilities,
                   realized_e_prices, realized_r_prices,
                   bp, tp, ep, mp, ekf_p, thp, elp, reg_p, pp=None) -> dict:

Fifteen positional parameters; nine of them config dataclasses (BatteryParams, TimeParams, EMSParams, MPCParams, EKFParams, ThermalParams, ElectricalParams, RegulationParams, PackParams), all defined in one 373-line file core/config/parameters.py. Seven call sites (comparison/*.py ×3, tests/*.py ×2, plus internal) each build all nine and pass them in order.

Consequences:

What it should be

  • One experiment config object composed of the parameter dataclasses (nesting is fine — that is what dotted paths are for), passed as one argument.
  • The introspection RCWS already has: fields, types, defaults, and later knob metadata (label, unit, doc, bounds, choices) — the declaration a form and a --set both read.
  • Component configs travel with their component (an estimator carries its EKFParams), so run_simulation never names one.

Done when

  • run_simulation(strategy, experiment_config) — or equivalent — and every caller migrated.
  • config_fields() returns every settable path; a --set path=value override engine exists and refuses unknown keys.
  • The stray Strategy enum is gone or renamed.
  • Proof: bit-identical traces at every caller.

Phase 1 of the platform epic; the piece the records (phase 2) are recorded from. Depends on #1.

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

    engineseams, run schema, data model

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions