fix: remove zoom to fit test for unused functionality
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Failing after 29s
CI / test (3.12) (pull_request) Failing after 43s
CI / test (3.14) (pull_request) Failing after 44s
CI / test (3.13) (pull_request) Failing after 47s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Failing after 47s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Failing after 53s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Failing after 54s
CI / test-with-coverage (pull_request) Failing after 54s
CI / coverage-analysis (pull_request) Skipped

This commit is contained in:
David Perl
2026-09-09 18:21:44 +02:00
parent 411bd2d9f4
commit 7f3f8bd78e
2 changed files with 3 additions and 37 deletions
@@ -167,38 +167,3 @@ def test_crystal_union_extends_grid_only_when_enabled(monkeypatch):
assert on.n_x > off.n_x # grid widened to reach the crystal
assert on.n_y == off.n_y # crystal is within the loop's y-range (same padding both)
def test_zoom_box_uses_loop_all_unless_clipped():
from aare.daq.operations.raster.service import RasterService
svc = RasterService.__new__(RasterService)
# loop_all fully inside the frame -> used for zoom
ok = mlb.MLRasterPlan(
grid_request=None,
loop_all_box=(100, 100, 400, 400),
loop_face_box=(150, 150, 300, 300),
image_width=1000,
image_height=1000,
)
assert svc._zoom_to_fit_box(ok) == (100, 100, 400, 400)
# loop_all touches the left edge (clipped) -> fall back to loop_face
clipped = mlb.MLRasterPlan(
grid_request=None,
loop_all_box=(0, 100, 400, 400),
loop_face_box=(150, 150, 300, 300),
image_width=1000,
image_height=1000,
)
assert svc._zoom_to_fit_box(clipped) == (150, 150, 300, 300)
# no loop_all -> loop_face
only_face = mlb.MLRasterPlan(
grid_request=None,
loop_all_box=None,
loop_face_box=(150, 150, 300, 300),
image_width=1000,
image_height=1000,
)
assert svc._zoom_to_fit_box(only_face) == (150, 150, 300, 300)
+3 -2
View File
@@ -1,5 +1,6 @@
from unittest.mock import MagicMock, patch
from aareDB import GridScanDecision, GridScanResult
import numpy as np
import pytest
from aarecommon.math.coordinate import Coordinate, SmargonCoordinate
@@ -277,13 +278,13 @@ def test_ingest_gridscan(mock_post, mock_api, mock_bl, sample_info, geom_model):
com = CenterOfMassModel(n_x=5.0, n_y=5.0)
wrapper.ingest_gridscan(
sample_info, raster_result, raster_request, geom_model, com, (500.0, 500.0)
sample_info, raster_result, raster_request, [], geom_model, com, (500.0, 500.0), GridScanDecision(algorithm="none", result=GridScanResult(found=False))
)
mock_post.assert_called_once()
# None sample
mock_post.reset_mock()
wrapper.ingest_gridscan(None, raster_result, raster_request, geom_model, com, (500.0, 500.0))
wrapper.ingest_gridscan(None, raster_result, raster_request, [], geom_model, com, (500.0, 500.0),GridScanDecision(algorithm="none", result=GridScanResult(found=False))
mock_post.assert_not_called()