captest.CapTest.to_yaml

CapTest.to_yaml(path, key='captest', merge_into_existing=True)

Serialize the curated CapTest configuration to a yaml file.

The written sub-mapping lives under the top-level key (default "captest") and contains every scalar param.* plus test_setup, any non-None override of reg_fml / reg_cols_meas / reg_cols_sim / rep_conditions, meas_path / sim_path (when the instance was constructed from paths), and non-empty meas_load_kwargs / sim_load_kwargs.

The applied filter chains of meas and sim are written as meas_filters / sim_filters (lists of filter-step config dicts from CapData.filters_to_config()), each only when non-empty; from_yaml re-applies them after data load and setup(). When a RepCond step is present in either pipeline, overrides.rep_conditions is omitted — the step is then the authoritative reporting-conditions source (avoids representing it in two places).

Percentile perc_wrap(N) callables inside rep_conditions['func'] are written back as "perc_N" strings so that from_yaml round-trips them. meas, sim, regression_results, _resolved_setup, and the loader callables are never serialized.

Parameters:
  • path (str or Path) – Destination yaml file.

  • key (str, default 'captest') – Top-level key under which the captest sub-mapping is written. Parametrizing this lets a single yaml hold multiple captest flavors (e.g. captest_e2848 and captest_bifi).

  • merge_into_existing (bool, default True) – When True and the destination file already exists and parses as a mapping, preserve the other top-level keys and overwrite only the sub-tree at key. When False, the destination is unconditionally replaced with a fresh mapping containing only key.

Return type:

None