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

Functions

 run (tmp_path, monkeypatch)
 write_gross (run, entity="LC2_Cal.CH1", times=(100.0, 200.0, 300.0), values=(50.0, 51.0, 52.0))
 write_sidecar (run, lines)
 test_offset_applies_only_after_the_tare_was_set (run)
 test_a_recal_line_moves_the_offset_again (run)
 test_a_clear_returns_the_trace_to_absolute (run)
 test_the_absolute_series_is_never_touched (run)
 test_gross_and_tared_do_not_share_a_cache_entry (run)
 test_no_sidecar_means_no_tared_component (run)
 test_a_channel_with_no_tare_gets_no_twin (run)
 test_a_sidecar_dropped_in_later_takes_effect_without_a_re_export (run)
 test_index_version_did_not_move (run)
 test_a_torn_final_line_does_not_lose_the_earlier_ones (run)
 test_a_missing_sidecar_is_empty_not_an_error (run)
 test_a_non_finite_offset_is_skipped (run)
 test_the_unit_matches_its_absolute_twin (run)

Detailed Description

Load-cell tare reconstruction in the viewer.

Run: cd webviewer && .venv/bin/python -m pytest backend/test_lc_tare.py -q

Hermetic — no elodin-db and no real run. Elodin archives ABSOLUTE force forever; the tare is
display state the backend recorded beside the run, and these tests pin the replay of it.

Every case names the wrong number it prevents:
  * a step applied across the whole array makes the PRE-tare part of every run read wrong;
  * a missed 'recal' line makes everything after a re-fit read wrong;
  * synthesising a tared twin unconditionally makes an untared run look tared;
  * synthesising in build_index instead of at serve time means a run exported before its sidecar
    landed never shows its tare, with the cached index quietly winning.

Function Documentation

◆ run()

backend.test_lc_tare.run ( tmp_path,
monkeypatch )
A scratch run: parquet cache and ELODIN_DIR both under tmp_path.

Definition at line 28 of file test_lc_tare.py.

◆ test_a_channel_with_no_tare_gets_no_twin()

backend.test_lc_tare.test_a_channel_with_no_tare_gets_no_twin ( run)

Definition at line 129 of file test_lc_tare.py.

References write_sidecar().

◆ test_a_clear_returns_the_trace_to_absolute()

backend.test_lc_tare.test_a_clear_returns_the_trace_to_absolute ( run)

Definition at line 83 of file test_lc_tare.py.

References write_gross(), and write_sidecar().

◆ test_a_missing_sidecar_is_empty_not_an_error()

backend.test_lc_tare.test_a_missing_sidecar_is_empty_not_an_error ( run)

Definition at line 177 of file test_lc_tare.py.

◆ test_a_non_finite_offset_is_skipped()

backend.test_lc_tare.test_a_non_finite_offset_is_skipped ( run)

Definition at line 181 of file test_lc_tare.py.

References write_sidecar().

◆ test_a_recal_line_moves_the_offset_again()

backend.test_lc_tare.test_a_recal_line_moves_the_offset_again ( run)

Definition at line 71 of file test_lc_tare.py.

References write_gross(), and write_sidecar().

◆ test_a_sidecar_dropped_in_later_takes_effect_without_a_re_export()

backend.test_lc_tare.test_a_sidecar_dropped_in_later_takes_effect_without_a_re_export ( run)

Definition at line 143 of file test_lc_tare.py.

References write_sidecar().

◆ test_a_torn_final_line_does_not_lose_the_earlier_ones()

backend.test_lc_tare.test_a_torn_final_line_does_not_lose_the_earlier_ones ( run)

Definition at line 166 of file test_lc_tare.py.

◆ test_gross_and_tared_do_not_share_a_cache_entry()

backend.test_lc_tare.test_gross_and_tared_do_not_share_a_cache_entry ( run)

Definition at line 103 of file test_lc_tare.py.

References write_gross(), and write_sidecar().

◆ test_index_version_did_not_move()

backend.test_lc_tare.test_index_version_did_not_move ( run)

Definition at line 158 of file test_lc_tare.py.

◆ test_no_sidecar_means_no_tared_component()

backend.test_lc_tare.test_no_sidecar_means_no_tared_component ( run)

Definition at line 117 of file test_lc_tare.py.

References write_gross().

◆ test_offset_applies_only_after_the_tare_was_set()

backend.test_lc_tare.test_offset_applies_only_after_the_tare_was_set ( run)

Definition at line 58 of file test_lc_tare.py.

References write_gross(), and write_sidecar().

◆ test_the_absolute_series_is_never_touched()

backend.test_lc_tare.test_the_absolute_series_is_never_touched ( run)

Definition at line 93 of file test_lc_tare.py.

References write_gross(), and write_sidecar().

◆ test_the_unit_matches_its_absolute_twin()

backend.test_lc_tare.test_the_unit_matches_its_absolute_twin ( run)

Definition at line 188 of file test_lc_tare.py.

◆ write_gross()

backend.test_lc_tare.write_gross ( run,
entity = "LC2_Cal.CH1",
times = (100.0, 200.0, 300.0),
values = (50.0, 51.0, 52.0) )

◆ write_sidecar()