pydynamicestimator.tests.baselines.inverter_baseline ==================================================== .. py:module:: pydynamicestimator.tests.baselines.inverter_baseline .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: pydynamicestimator.tests.baselines.inverter_baseline.FIXTURE_ROOT pydynamicestimator.tests.baselines.inverter_baseline._BASE pydynamicestimator.tests.baselines.inverter_baseline.SIM_LD_STRIDE pydynamicestimator.tests.baselines.inverter_baseline.T_END pydynamicestimator.tests.baselines.inverter_baseline.BASELINES pydynamicestimator.tests.baselines.inverter_baseline._COMMON pydynamicestimator.tests.baselines.inverter_baseline._INT_OPTS Functions --------- .. autoapisummary:: pydynamicestimator.tests.baselines.inverter_baseline.make_inverter_baseline_config pydynamicestimator.tests.baselines.inverter_baseline.run_inverter_case Module Contents --------------- .. py:data:: FIXTURE_ROOT .. py:data:: _BASE .. py:data:: SIM_LD_STRIDE :value: 50 .. py:data:: T_END :value: 5.0 .. py:data:: BASELINES .. py:data:: _COMMON .. py:data:: _INT_OPTS .. py:function:: make_inverter_baseline_config(case: str) Return the config for one baseline ``case`` (``sim_ld`` / ``sim_alg`` / ``est``). .. py:function:: run_inverter_case(case: str) -> numpy.ndarray Run one baseline ``case`` and return the array the gate compares (the estimated trajectory for ``est``, otherwise the simulated trajectory; decimated for ``sim_ld``).