From 7f3f8bd78ef58918dc28b4fdc8df194e8a4909ad Mon Sep 17 00:00:00 2001 From: David Perl Date: Wed, 9 Sep 2026 18:16:47 +0200 Subject: [PATCH] fix: remove zoom to fit test for unused functionality --- .../daq/operations/test_ml_raster_plan.py | 35 ------------------- tests/unit/daq/test_aaredb.py | 5 +-- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/tests/unit/daq/operations/test_ml_raster_plan.py b/tests/unit/daq/operations/test_ml_raster_plan.py index fc3f22d2..225ee0a9 100644 --- a/tests/unit/daq/operations/test_ml_raster_plan.py +++ b/tests/unit/daq/operations/test_ml_raster_plan.py @@ -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) diff --git a/tests/unit/daq/test_aaredb.py b/tests/unit/daq/test_aaredb.py index e3ab9dc2..91f860b4 100644 --- a/tests/unit/daq/test_aaredb.py +++ b/tests/unit/daq/test_aaredb.py @@ -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()