From 0da0ebf3255207510fdd579e4e346a1f590b3e86 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Thu, 4 Dec 2025 11:29:22 +0100 Subject: [PATCH] aaredb: fixedbug where calling non-existent model due to versioning issues --- daq/src/aaredaq/aaredb.py | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/daq/src/aaredaq/aaredb.py b/daq/src/aaredaq/aaredb.py index 2c397c49..c86daa2f 100644 --- a/daq/src/aaredaq/aaredb.py +++ b/daq/src/aaredaq/aaredb.py @@ -33,7 +33,7 @@ from aaredaqlib.models import ( ) from aaredaqlib.beamline import MXBeamline -from aaredaqlib.raster_grid import RasterGridRequest, RasterPayloadModel, CenterOfMassModel, ScreeningPayloadModel +from aaredaqlib.raster_grid import RasterGridRequest, RasterPayloadModel, CenterOfMassModel from aaredaqlib.rotation_scan import RotationScanRequest from aaredaqlib.sample_geometry import SampleGeometryModel @@ -420,32 +420,3 @@ class AareWrapper: print(e) raise e - def ingest_screening(self, sample: Optional[SampleShortInfo], screening_result:ScanResult): - - if sample is None: - return - - payload = self.format_screening_payload(sample, screening_result=screening_result).model_dump() - - if payload is None: - return - - url = f"{self.__host}/protected_router/gridscan_runner/ingest" - headers = { - "accept": "application/json", - "X-Shared-Password": os.getenv("AAREDB_SHARED_PASSWORD") - } - response = requests.post(url, - auth=(os.getenv("AAREDB_USERNAME"), os.getenv("AAREDB_PASSWORD")), - headers=headers, data=json.dumps(payload), timeout=30, verify=False) - response.raise_for_status() - - print(f"Response status code: {response.status_code}") - - def format_screening_payload(self, sample: Optional[SampleShortInfo], screening_result:ScanResult): - return ScreeningPayloadModel( - sample_id=sample.db_id, - result=screening_result, - attach_image=True - ) -