captest.CapTest.from_mapping
- classmethod CapTest.from_mapping(sub, *, key='captest', base_dir=None, meas_loader=None, sim_loader=None)
Construct a CapTest from an already-parsed captest sub-mapping.
Direct-handoff constructor used by downstream wrappers that mutate the captest sub-mapping in memory – applying project-specific defaults, promoting fields, injecting paths – before asking captest to validate and build the
CapTest. Exposes the same validate-and-construct pipeline thatfrom_yamlruns after reading the file, without the file read.- Parameters:
sub (dict) – Captest sub-mapping. Typically obtained from
load_config()or assembled by a downstream wrapper. Must containtest_setup. Supported keys are declared by_CAPTEST_YAML_KEYS/_CAPTEST_OVERRIDE_KEYS.subis not mutated.key (str, default 'captest') – Purely used in error messages (e.g. “Unknown key ‘x’ under the ‘captest’ sub-mapping”). Match the top-level yaml key under which this sub-mapping would normally live so error messages point users at the right place in their config file.
base_dir (str, Path, or None, default None) – Base directory used to resolve relative
meas_path/sim_pathvalues insub. If the sub-mapping contains any relative path andbase_dirisNone, raisesValueError. URI-scheme values in the sub-mapping (e.g.s3://bucket/path) are treated as absolute and skip resolution even thoughpathlib.Path.is_absolute()returns False for them. URI-schemebase_dirvalues are joined to relative paths via string concatenation so the scheme is preserved; localbase_dirvalues are joined viapathlib.Path.meas_loader (callable or None, optional) – Programmatic-only loader callables that override the default resolution (
captest.io.load_data/captest.io.load_pvsyst). Same semantics asfrom_yaml().sim_loader (callable or None, optional) – Programmatic-only loader callables that override the default resolution (
captest.io.load_data/captest.io.load_pvsyst). Same semantics asfrom_yaml().
- Return type: