|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| List[Path] | _preset_search_dirs (Path config_dir) |
| List[str] | _available_presets (Path config_dir) |
| Any | _deep_merge_preset (Any preset, Any override, str path="") |
| None | _check_preset_coherence (str name, Dict[str, Any] preset, Dict[str, Any] merged) |
| str | _canon_fluid (name) |
| None | _check_fluid_cea_coherence (Dict[str, Any] data) |
| Dict[str, Any] | _apply_propellant_preset (Dict[str, Any] data, Path config_dir) |
| PintleEngineConfig | load_config (Union[str, Path] config_path) |
| None | save_results (Dict[str, Any] results, Union[str, Path] output_path) |
Variables | |
| _log = logging.getLogger(__name__) | |
| _PROJECT_ROOT = Path(__file__).resolve().parents[2] | |
| dict | _FLUID_ALIASES |
Configuration loading and result saving
|
protected |
If ``propellant_preset`` is set, merge the preset under explicit-YAML-wins semantics.
Definition at line 146 of file io.py.
References _check_preset_coherence(), _deep_merge_preset(), and _preset_search_dirs().
Referenced by load_config().
|
protected |
Definition at line 22 of file io.py.
References _preset_search_dirs().
|
protected |
Canonical key for a fluid name, or the lowercased name when unrecognised.
Definition at line 85 of file io.py.
Referenced by _check_fluid_cea_coherence().
|
protected |
Fail when ``fluids`` and ``combustion.cea`` describe DIFFERENT propellants. This used to live inside _check_preset_coherence, which only runs when a config names a ``propellant_preset``. Leave the preset unset -- which is exactly what the UI does when no propellant is picked -- and the guard was skipped entirely: a config could carry methane fluid properties while the chemistry came from the LOX/Ethanol CEA table, and it loaded without a word. The injector would flow one propellant's density and the chamber would burn another's thermochemistry, and every number downstream would look completely plausible. The physics does not care whether a preset was named, so neither does this check.
Definition at line 96 of file io.py.
References _canon_fluid().
Referenced by load_config().
|
protected |
Hard-fail when explicit config fields contradict the preset's PROPELLANT IDENTITY. Explicit-wins is fine for property tweaks (density, viscosity, …), but a stale explicit CEA section or fluid *name* from a previous propellant produces physically-wrong results that look plausible (the hardcoded-Cd bug class). Identity mismatches are errors, not overrides.
Definition at line 46 of file io.py.
Referenced by _apply_propellant_preset().
|
protected |
Recursive merge: ``override`` (explicit config) wins on every leaf; overridden preset leaves are logged so silently-differing values stay visible (UNIFICATION_PLAN Phase 2a).
Definition at line 30 of file io.py.
References _deep_merge_preset().
Referenced by _apply_propellant_preset(), and _deep_merge_preset().
|
protected |
Preset lookup order: next to the config file first, then the repo's configs/propellants.
Definition at line 17 of file io.py.
Referenced by _apply_propellant_preset(), and _available_presets().
| PintleEngineConfig engine.pipeline.io.load_config | ( | Union[str, Path] | config_path | ) |
Load engine configuration from YAML file.
If the YAML carries ``propellant_preset: <name>`` (e.g. methalox, ethalox, kerolox), the file
``configs/propellants/<name>.yaml`` is deep-merged in BEFORE validation: the preset supplies the
propellant baseline (fluids, CEA setup) and any field given explicitly in the config wins (each
such override is logged). ``custom`` or absent = no preset (legacy behavior, unchanged).
Parameters:
-----------
config_path : str | Path
Path to YAML configuration file
Returns:
--------
config : PintleEngineConfig
Validated configuration object
Definition at line 168 of file io.py.
References _apply_propellant_preset(), and _check_fluid_cea_coherence().
| None engine.pipeline.io.save_results | ( | Dict[str, Any] | results, |
| Union[str, Path] | output_path ) |
|
protected |
|
protected |