|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| str | unit_of (str name) |
| Any | _cell (Any v) |
| bool | _is_column (Any v, int n) |
| None | _walk (str prefix, Any block, int n, List[Tuple[str, List[Any], Optional[str]]] out, List[str] skipped, int depth=0) |
| List[Any] | _place (int n, Sequence[int] rows, Sequence[Any] values) |
| Optional[List[int]] | _rows_of (Sequence[Any] times, Sequence[float] t, float tol=1e-6) |
| Tuple[List[Tuple[str, str, List[Any]]], List[str]] | columns (Mapping[str, Any] result) |
| None | _diagnostic (str prefix, Any block, Sequence[float] t, Any add, List[str] skipped, Optional[List[int]] rows=None, int depth=0) |
| str | _header (str name, str unit) |
| str | to_csv (Mapping[str, Any] result) |
| Dict[str, Tuple[str, List[Optional[float]]]] | read_csv (str text) |
| bytes | to_parquet (Mapping[str, Any] result) |
| Tuple[List[float], List[Optional[float]], str] | _engine_history (Mapping[str, Any] result, str key_delivered, str key_twin) |
| Optional[Dict[str, float]] | _peak (Sequence[float] t, Sequence[Optional[float]] v) |
| str | _csv (Iterable[Sequence[Any]] rows) |
| Optional[List[List[Any]]] | _heatflux_rows (Mapping[str, Any] side, str qkey, Optional[str] tkey) |
| bytes | fea_bundle (Mapping[str, Any] result, Optional[Mapping[str, Any]] sidecar=None) |
| str | _readme (Mapping[str, str] files, str pc_src, str f_src, Optional[Mapping[str, Any]] sidecar) |
Variables | |
| float | PSI = 6894.757293168361 |
| tuple | _SUFFIX_UNITS |
| dict | _NAME_UNITS |
| NOT_HISTORIES | |
| HEADER_RE = re.compile(r"^(?P<name>.*) \[(?P<unit>[^\]]*)\]$") | |
A Layer X run, exported (DATA-CONTRACT 4: ``GET /api/layerx/runs/{id}/export/{fmt}``).
* :func:`to_csv` -- every per-step signal in the result, one row per twin step (``series.t``), one
column per signal, headed ``name [unit]``. The series, the delivered (replay) columns on the firing
steps, the replay's own points on their steps, the full network record and every diagnostics
column that follows the series. Floats are written with ``repr``, so they read back bit for bit.
* :func:`to_parquet` -- the same table as Parquet (pyarrow), each field's unit in its metadata.
* :func:`fea_bundle` -- a zip for structural and thermal analysis: ``pc_t.csv``, ``thrust_t.csv``,
``heatflux_xt.csv`` (from the ``axial`` sidecar, when given), ``loads.json`` with the peak loads,
and ``README.txt`` with units and basis.
Nothing is interpolated onto the twin's grid. A value sampled at a replay point is written on that
point's step and left empty elsewhere: a table must not imply a resolution the model did not have.
A block on its own clock that does not land on the twin's steps is not written to the table;
:func:`columns` returns what was left out, and the Parquet file's metadata lists it
(``columns_skipped``).
|
protected |
Definition at line 64 of file export.py.
Referenced by _diagnostic(), _engine_history(), _heatflux_rows(), _place(), _walk(), columns(), and fea_bundle().
|
protected |
Definition at line 363 of file export.py.
Referenced by fea_bundle().
|
protected |
Write the histories under a diagnostics block. A block carrying its own ``index`` (series steps) or ``t`` (times that are series steps) places its lists on those steps, and its children inherit that clock; a list on no known clock is listed in ``skipped``.
Definition at line 225 of file export.py.
References _cell(), _diagnostic(), _place(), and _rows_of().
Referenced by _diagnostic(), and columns().
|
protected |
``(t, values, source)`` over the firing steps: EngineDesign's delivered values when the run has them (the eroding engine), else the twin's own chamber.
Definition at line 339 of file export.py.
References _cell().
Referenced by fea_bundle().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 97 of file export.py.
References _cell().
Referenced by _diagnostic(), and columns().
|
protected |
Definition at line 461 of file export.py.
Referenced by fea_bundle().
|
protected |
The series step of each time, when every time is one of the series' steps; else None.
Definition at line 105 of file export.py.
Referenced by _diagnostic(), and columns().
|
protected |
| Tuple[List[Tuple[str, str, List[Any]]], List[str]] engine.layerx.export.columns | ( | Mapping[str, Any] | result | ) |
``([(name, unit, values)], skipped)``: the export table, one entry per column, every column as long as ``series.t``; and the dotted names of per-point blocks that were not on the twin's steps.
Definition at line 120 of file export.py.
References _cell(), _diagnostic(), _is_column(), _place(), _rows_of(), _walk(), and unit_of().
Referenced by to_csv(), and to_parquet().
| bytes engine.layerx.export.fea_bundle | ( | Mapping[str, Any] | result, |
| Optional[Mapping[str, Any]] | sidecar = None ) |
The loads a structural or thermal model needs, as a zip (bytes).
``sidecar`` is the run's ``axial`` sidecar (``{x_mm, t, q_MW_m2, T_wall_K}``, rows t, columns x);
without it there is no ``heatflux_xt.csv`` and ``loads.json`` says so.
Definition at line 386 of file export.py.
References _cell(), _csv(), _engine_history(), _heatflux_rows(), _peak(), _readme(), and max.
| Dict[str, Tuple[str, List[Optional[float]]]] engine.layerx.export.read_csv | ( | str | text | ) |
| str engine.layerx.export.to_csv | ( | Mapping[str, Any] | result | ) |
| bytes engine.layerx.export.to_parquet | ( | Mapping[str, Any] | result | ) |
| str engine.layerx.export.unit_of | ( | str | name | ) |
The unit a Layer X key carries, from the repo's naming convention (``*_psia``, ``*_K``, ...); ``1`` for a key without a unit suffix, which in this result is a ratio or a fraction (ΔP/Pc, O/F, ε, η, margins). Instrument and network columns pass their own unit explicitly.
Definition at line 51 of file export.py.
Referenced by columns().
|
protected |
|
protected |
| engine.layerx.export.HEADER_RE = re.compile(r"^(?P<name>.*) \[(?P<unit>[^\]]*)\]$") |
| engine.layerx.export.NOT_HISTORIES |