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

Functions

None test_a_parameter_with_no_source_is_rejected ()
None test_a_source_must_be_one_of_the_declared_kinds ()
None test_the_source_must_be_the_enum_not_a_string ()
None test_an_unknown_unit_is_caught_at_construction ()
None test_value_is_stored_as_authored_and_converted_on_demand ()
None test_round_trip_through_json_is_exact ()
None test_optional_fields_are_omitted_rather_than_nulled ()
None test_uncertainty_bounds ()
None test_uncertainty_kind_is_checked (str kind)
None test_uncertainty_cannot_be_negative ()
None test_si_bounds_are_in_canonical_units ()
None test_provenance_is_ranked_so_measurements_win ()
None test_assumed_flags_the_values_nobody_established ()
None test_a_report_can_say_what_a_result_rests_on ()
None test_summary_always_reports_every_kind ()

Detailed Description

Provenance is mandatory, and survives a round trip.

Phase 02's headline exit criterion is that *a parameter with no source is a
validation error rather than a default*. That is what these tests hold. The rest
check that the record survives serialisation intact, because provenance that is
lost on the first save is provenance that does not exist.

Function Documentation

◆ test_a_parameter_with_no_source_is_rejected()

None test_model_param.test_a_parameter_with_no_source_is_rejected ( )
The criterion, stated directly.

A missing source must not default to anything -- not to ESTIMATED, not to
DEFAULT. Defaulting it would mean every un-sourced number silently acquired
a plausible-looking provenance, which is worse than having none at all.

Definition at line 25 of file test_model_param.py.

◆ test_a_report_can_say_what_a_result_rests_on()

None test_model_param.test_a_report_can_say_what_a_result_rests_on ( )
The point of carrying provenance at all.

"Nine measured, four datasheet, two guesses" is a different claim from a
bare number, and the difference should never be invisible in a design
review.

Definition at line 130 of file test_model_param.py.

◆ test_a_source_must_be_one_of_the_declared_kinds()

None test_model_param.test_a_source_must_be_one_of_the_declared_kinds ( )

Definition at line 36 of file test_model_param.py.

◆ test_an_unknown_unit_is_caught_at_construction()

None test_model_param.test_an_unknown_unit_is_caught_at_construction ( )

Definition at line 49 of file test_model_param.py.

◆ test_assumed_flags_the_values_nobody_established()

None test_model_param.test_assumed_flags_the_values_nobody_established ( )

Definition at line 123 of file test_model_param.py.

◆ test_optional_fields_are_omitted_rather_than_nulled()

None test_model_param.test_optional_fields_are_omitted_rather_than_nulled ( )
A terse parameter stays terse when written back.

Definition at line 81 of file test_model_param.py.

◆ test_provenance_is_ranked_so_measurements_win()

None test_model_param.test_provenance_is_ranked_so_measurements_win ( )

Definition at line 117 of file test_model_param.py.

◆ test_round_trip_through_json_is_exact()

None test_model_param.test_round_trip_through_json_is_exact ( )
A parameter survives the full save/load path unchanged.

Definition at line 68 of file test_model_param.py.

◆ test_si_bounds_are_in_canonical_units()

None test_model_param.test_si_bounds_are_in_canonical_units ( )

Definition at line 109 of file test_model_param.py.

◆ test_summary_always_reports_every_kind()

None test_model_param.test_summary_always_reports_every_kind ( )
A stable table, so a report does not gain and lose columns.

Definition at line 152 of file test_model_param.py.

◆ test_the_source_must_be_the_enum_not_a_string()

None test_model_param.test_the_source_must_be_the_enum_not_a_string ( )
Constructed directly, a stringly-typed source is a type error.

Definition at line 43 of file test_model_param.py.

◆ test_uncertainty_bounds()

None test_model_param.test_uncertainty_bounds ( )

Definition at line 87 of file test_model_param.py.

◆ test_uncertainty_cannot_be_negative()

None test_model_param.test_uncertainty_cannot_be_negative ( )

Definition at line 104 of file test_model_param.py.

◆ test_uncertainty_kind_is_checked()

None test_model_param.test_uncertainty_kind_is_checked ( str kind)

Definition at line 99 of file test_model_param.py.

◆ test_value_is_stored_as_authored_and_converted_on_demand()

None test_model_param.test_value_is_stored_as_authored_and_converted_on_demand ( )
Round-trip fidelity depends on keeping the authored form.

Converting on construction would mean a config written in psi came back as
a float with a trail of decimals -- a diff on every save, and a file that no
longer looks like what someone wrote.

Definition at line 54 of file test_model_param.py.