aaredb: fixedbug where calling non-existent model due to versioning issues
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user