blissoda.tests.test_stop_scan_preset#
Unit tests for the StopIntegrateSum attenuation “freeze-mode” state machine.
These tests drive ScanPointIterator._frame0_setup_step directly with a
mocked parent preset, no Bliss session is needed. Integration tests are not adequate
to check freeze mode as the demo Bliss detector (difflab6) does not respond
to changes in attenuation (e.g. via setup_globals.atten.bits).
Functions
Malformed metric events are logged and dropped without crashing. |
|
_check_workflow_events routes each event type to the right sink. |
|
|
No frame-0 metric within metric_timeout → default to 'standard'. |
Spotty-stable branch runs the safe-frame loop then adds extra atten. |
|
Spotty-unstable branch keeps safe_atten and freezes immediately. |
|
Standard-branch safe-frame loop converges and then freezes attenuation. |
|
Frame 0 below threshold and stepping down stays below → keep stepping down until the predict-back-up check triggers the final +1 hysteresis. |
|
In |