Merge branch 'sharpness-monitor-none' into 'v3'

Sharpness monitor accepting 0 as None

Closes #776

See merge request openflexure/openflexure-microscope-server!592
This commit is contained in:
Joe Knapper 2026-05-15 15:27:52 +00:00
commit bea1e35d61
2 changed files with 14 additions and 2 deletions

View file

@ -130,6 +130,18 @@ def test_record_defaults_to_method(mock_stage, mock_camera):
assert monitor.record == SharpnessMethod.FOCUS_FOM
def test_zero_record_defaults_to_method(mock_stage, mock_camera):
"""If record=0, only the selected method is recorded."""
monitor = JPEGSharpnessMonitor(
mock_stage,
mock_camera,
method=SharpnessMethod.FOCUS_FOM,
record=0,
)
assert monitor.record == SharpnessMethod.FOCUS_FOM
def test_record_must_include_selected_method(mock_stage, mock_camera):
"""The selected autofocus metric must also be recorded."""
with pytest.raises(ValueError, match="not being recorded"):