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 25s
CI / test (3.12) (pull_request) Failing after 1m5s
CI / test (3.13) (pull_request) Failing after 1m7s
CI / test (3.14) (pull_request) Failing after 1m10s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Failing after 1m13s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Failing after 1m17s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Failing after 1m16s
CI / test-with-coverage (pull_request) Failing after 1m30s
CI / coverage-analysis (pull_request) Skipped
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 25s
CI / test (3.12) (pull_request) Failing after 1m5s
CI / test (3.13) (pull_request) Failing after 1m7s
CI / test (3.14) (pull_request) Failing after 1m10s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Failing after 1m13s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Failing after 1m17s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Failing after 1m16s
CI / test-with-coverage (pull_request) Failing after 1m30s
CI / coverage-analysis (pull_request) Skipped
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -7,6 +7,7 @@ from aarecommon.math.sample_geometry import SampleGeometryModel
|
||||
from aarecommon.models.models import DewarAddress, PuckLoadedInfo, SampleShortInfo
|
||||
from aarecommon.models.raster_grid import CenterOfMassModel, RasterGridRequest
|
||||
from aarecommon.models.rotation_scan import RotationScanRequest
|
||||
from aareDB import GridScanDecision, GridScanResult
|
||||
from jfjoch_client.models import ScanResult
|
||||
|
||||
from aare.daq.aaredb import AareWrapper
|
||||
@@ -277,13 +278,29 @@ 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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user