pyradtran.params.ParamResolver#
- class pyradtran.params.ParamResolver(config, params: Dict[str, Any] | None = None, schema: Any = 'auto')[source]#
Bases:
objectResolve a user
paramsmapping into validated per-point values.Responsibilities:
Apply and consume dotted config overrides (
"simulation_defaults.albedo_value") onto config — they never reach the uvspec input file.Split remaining entries into literals (validated immediately) and
Varreferences (validated per point).Tag every value with its provenance.
- Parameters:
config (SimulationConfig) – Mutated in place by dotted keys.
params (dict, optional) – Mapping of registry keys / raw uvspec keywords to literal values or
Varreferences.
- Raises:
ValidationError – If any literal value fails its registry validation. All offending keys are reported in one exception.
- resolve_point(point_ds)[source]#
Resolve all parameters for one stacked point.
- Parameters:
point_ds (xarray.Dataset) – A single point (0-d variables), as produced by
stacked_ds.isel({sample_dim: i}).- Returns:
resolved (dict) –
key -> (value, provenance)merged from literals and per-point references.skipped (list of str) – Keys omitted for this point because the dataset value was NaN.
- static_params() Dict[str, Tuple[Any, str]][source]#
Return
key -> (value, provenance)for point-independent values.
- validate_var_targets(ds) None[source]#
Check every
Vartarget (and hijack-suspects) against ds.- Raises:
ValidationError – If a
Varnames a variable missing from ds, or if a bare string literal matches a dataset variable name (ambiguous — the user almost certainly meantVar).