pydynamicestimator.tests.baselines.inverter_baseline

Shared configuration + runner for the inverter byte-identical baselines.

Single source of truth for the IEEE39_bus_inverter baseline runs, imported by both create_baseline_inverter.py (which pickles the references) and the test_recur_{sim,est}_inverter.py gates (which compare against them). Keeping the config here prevents drift between baseline-creation and the tests – any drift would surface as a spurious byte-identity failure rather than a real regression.

This is Phase 0 of docs/inverter_modernization_design.md: the byte-identical safety net the whole inverter refactor rests on. Three cases gate the surface the fgcall/finit refactor touches:

  • sim_ld – SIM, line_dyn=True (ODE; cvodes): 2 GridForming + 3 GridFollowing + 5 SGs through the t=4.0 bus fault. Run at the production output step ts=1e-4 but stored decimated (every SIM_LD_STRIDE-th sample) so the pickle stays ~1 MB – a byte-identical refactor matches at every sample, so the decimated reference is just as catching.

  • sim_alg – SIM, line_dyn=False (algebraic network / DAE; idas): the distinct code path the eventual LCL_static realization will exercise.

  • est – estimation (iekf) over the IEEE39_bus_inverter est model, which carries both a GridForming and a GridFollowing (GFLI7_est at bus 36) so the GFL/PLL estimation path (qcall, algebraic weights, finit) is gated too.

Baselines store only the x_full numpy arrays, not the whole DaeSim/DaeEst objects: under pytest’s pythonpath="pydynamicestimator" + --import-mode=importlib, system.DaeSim is reachable under two module paths, so whole-object pickling raises “it’s not the same object”. The arrays are all the gates compare anyway.

Attributes

FIXTURE_ROOT

_BASE

SIM_LD_STRIDE

T_END

BASELINES

_COMMON

_INT_OPTS

Functions

make_inverter_baseline_config(case)

Return the config for one baseline case (sim_ld / sim_alg / est).

run_inverter_case(→ numpy.ndarray)

Run one baseline case and return the array the gate compares (the

Module Contents

pydynamicestimator.tests.baselines.inverter_baseline.FIXTURE_ROOT
pydynamicestimator.tests.baselines.inverter_baseline._BASE
pydynamicestimator.tests.baselines.inverter_baseline.SIM_LD_STRIDE = 50
pydynamicestimator.tests.baselines.inverter_baseline.T_END = 5.0
pydynamicestimator.tests.baselines.inverter_baseline.BASELINES
pydynamicestimator.tests.baselines.inverter_baseline._COMMON
pydynamicestimator.tests.baselines.inverter_baseline._INT_OPTS
pydynamicestimator.tests.baselines.inverter_baseline.make_inverter_baseline_config(case: str)[source]

Return the config for one baseline case (sim_ld / sim_alg / est).

Parameters:

case (str)

pydynamicestimator.tests.baselines.inverter_baseline.run_inverter_case(case: str) numpy.ndarray[source]

Run one baseline case and return the array the gate compares (the estimated trajectory for est, otherwise the simulated trajectory; decimated for sim_ld).

Parameters:

case (str)

Return type:

numpy.ndarray