STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_layerx_export Namespace Reference

Functions

 _run ()
 _series_leaves (series)
 _num (v)
 test_every_signal_round_trips_through_csv_exactly ()
 test_replay_points_sit_on_their_own_steps_and_nowhere_else ()
 test_network_and_series_clock_diagnostics_are_written ()
 test_what_is_not_on_the_twins_clock_is_left_out_and_reported ()
 test_headers_are_stable_whatever_the_dict_order ()
 test_units_follow_the_naming_convention ()
 test_parquet_carries_the_same_table_with_units ()
 test_parquet_ships_with_the_server ()
 _sidecar ()
 test_the_fea_bundle_carries_the_named_files_and_its_peaks_are_the_histories_maxima ()
 test_without_a_replay_or_a_sidecar_the_bundle_says_where_its_numbers_came_from ()
 test_saved_runs_export_every_series_column_and_round_trip ()

Variables

str RUNS = Path(__file__).resolve().parents[1] / ".userdata" / "local" / "engine" / "layerx" / "runs"
float PSI = 6894.757293168361
list SAVED = [f for f in sorted(glob.glob(str(RUNS / "*.json")))]

Detailed Description

Exports of a Layer X run (engine/layerx/export.py): CSV, Parquet and the FEA bundle.

What these check:

* **Round trip, bit for bit.** Every per-step signal of a run (series, delivered, replay, network,
  diagnostics) is written and read back to the same float, with its unit in the header.
* **Nothing is interpolated.** A replay-point value sits on its own step and nowhere else; a block on
  a clock that is not the twin's is left out and reported, not resampled.
* **Every series leaf is there.** The test enumerates the series by its own walk and asserts each
  numeric column appears, on a hand-built run and on the user's saved runs (read only).
* **FEA bundle**: the files the contract names, the peak loads equal the maxima of the histories they
  come from, the heat-flux table has one row per (t, x), and the zip is byte-identical run to run.

Function Documentation

◆ _num()

test_layerx_export._num ( v)
protected

◆ _run()

◆ _series_leaves()

test_layerx_export._series_leaves ( series)
protected
The series' numeric columns, by an independent walk: (dotted name, values).

Definition at line 81 of file test_layerx_export.py.

Referenced by test_every_signal_round_trips_through_csv_exactly(), and test_saved_runs_export_every_series_column_and_round_trip().

◆ _sidecar()

test_layerx_export._sidecar ( )
protected

◆ test_every_signal_round_trips_through_csv_exactly()

test_layerx_export.test_every_signal_round_trips_through_csv_exactly ( )

Definition at line 103 of file test_layerx_export.py.

References _num(), _run(), and _series_leaves().

◆ test_headers_are_stable_whatever_the_dict_order()

test_layerx_export.test_headers_are_stable_whatever_the_dict_order ( )

Definition at line 148 of file test_layerx_export.py.

References _run().

◆ test_network_and_series_clock_diagnostics_are_written()

test_layerx_export.test_network_and_series_clock_diagnostics_are_written ( )

Definition at line 125 of file test_layerx_export.py.

References _run().

◆ test_parquet_carries_the_same_table_with_units()

test_layerx_export.test_parquet_carries_the_same_table_with_units ( )

Definition at line 168 of file test_layerx_export.py.

References _run(), and decode().

◆ test_parquet_ships_with_the_server()

test_layerx_export.test_parquet_ships_with_the_server ( )
The UI offers "Every signal (Parquet)". Without pyarrow in the image (Dockerfile.api and CI install
requirements-base.txt) every click answered HTTP 501, and the test above skipped itself, so CI never
noticed. The base list carries it.

Definition at line 182 of file test_layerx_export.py.

◆ test_replay_points_sit_on_their_own_steps_and_nowhere_else()

test_layerx_export.test_replay_points_sit_on_their_own_steps_and_nowhere_else ( )

Definition at line 116 of file test_layerx_export.py.

References _run().

◆ test_saved_runs_export_every_series_column_and_round_trip()

test_layerx_export.test_saved_runs_export_every_series_column_and_round_trip ( )

Definition at line 240 of file test_layerx_export.py.

References _num(), _series_leaves(), and read().

◆ test_the_fea_bundle_carries_the_named_files_and_its_peaks_are_the_histories_maxima()

test_layerx_export.test_the_fea_bundle_carries_the_named_files_and_its_peaks_are_the_histories_maxima ( )

Definition at line 197 of file test_layerx_export.py.

References _run(), _sidecar(), decode(), and max.

◆ test_units_follow_the_naming_convention()

test_layerx_export.test_units_follow_the_naming_convention ( )

Definition at line 156 of file test_layerx_export.py.

◆ test_what_is_not_on_the_twins_clock_is_left_out_and_reported()

test_layerx_export.test_what_is_not_on_the_twins_clock_is_left_out_and_reported ( )

Definition at line 136 of file test_layerx_export.py.

References _run().

◆ test_without_a_replay_or_a_sidecar_the_bundle_says_where_its_numbers_came_from()

test_layerx_export.test_without_a_replay_or_a_sidecar_the_bundle_says_where_its_numbers_came_from ( )

Definition at line 225 of file test_layerx_export.py.

References _run().

Variable Documentation

◆ PSI

float test_layerx_export.PSI = 6894.757293168361

Definition at line 29 of file test_layerx_export.py.

◆ RUNS

str test_layerx_export.RUNS = Path(__file__).resolve().parents[1] / ".userdata" / "local" / "engine" / "layerx" / "runs"

Definition at line 28 of file test_layerx_export.py.

◆ SAVED

list test_layerx_export.SAVED = [f for f in sorted(glob.glob(str(RUNS / "*.json")))]

Definition at line 236 of file test_layerx_export.py.