Fix job type assignment and clean up testfunctions file.
Updated job type to reference `experiment.type` in `processing.py` for accurate data handling. Cleaned up and streamlined `testfunctions.ipynb` by removing outdated and redundant code, improving readability and usability.
This commit is contained in:
@ -662,8 +662,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-04-30T08:39:47.839505Z",
|
||||
"start_time": "2025-04-30T08:39:47.810814Z"
|
||||
"end_time": "2025-04-30T09:31:19.697284Z",
|
||||
"start_time": "2025-04-30T09:31:19.678837Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@ -682,11 +682,11 @@
|
||||
"# Build the nested parameters\n",
|
||||
"rotation = RotationParameters(\n",
|
||||
" omegaStart_deg=0.0,\n",
|
||||
" omegaStep=0.1,\n",
|
||||
" omegaStep=0.2,\n",
|
||||
" phi=10.0,\n",
|
||||
" chi=0.0,\n",
|
||||
" numberOfImages=3600,\n",
|
||||
" exposureTime_s=0.02\n",
|
||||
" numberOfImages=1800,\n",
|
||||
" exposureTime_s=0.01\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"#characterization = characterizationParameters(\n",
|
||||
@ -718,9 +718,9 @@
|
||||
" model=\"PILATUS4 2M\",\n",
|
||||
" type=\"photon-counting\",\n",
|
||||
" serialNumber=\"16684dscsd668468\",\n",
|
||||
" detectorDistance_mm=95.0,\n",
|
||||
" beamCenterX_px=512.0,\n",
|
||||
" beamCenterY_px=512.0,\n",
|
||||
" detectorDistance_mm=232.0,\n",
|
||||
" beamCenterX_px=768.0,\n",
|
||||
" beamCenterY_px=857.0,\n",
|
||||
" pixelSizeX_um=150.0,\n",
|
||||
" pixelSizeY_um=150.0,\n",
|
||||
")\n",
|
||||
@ -729,11 +729,11 @@
|
||||
" synchrotron=\"Swiss Light Source\",\n",
|
||||
" beamline=\"PXIII\",\n",
|
||||
" detector=detector_data,\n",
|
||||
" wavelength=1.0,\n",
|
||||
" ringCurrent_A=0.0,\n",
|
||||
" ringMode=\"Machine Down\",\n",
|
||||
" wavelength=1.033,\n",
|
||||
" ringCurrent_A=0.4,\n",
|
||||
" ringMode=\"Machine Development\",\n",
|
||||
" monochromator=\"Si111\",\n",
|
||||
" transmission=1.00,\n",
|
||||
" transmission=10.00,\n",
|
||||
" focusingOptic=\"Kirkpatrick-Baez\",\n",
|
||||
" beamlineFluxAtSample_ph_s=0,\n",
|
||||
" beamSizeWidth=30.0,\n",
|
||||
@ -780,7 +780,7 @@
|
||||
"DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): localhost:8000\n",
|
||||
"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n",
|
||||
" warnings.warn(\n",
|
||||
"DEBUG:urllib3.connectionpool:https://localhost:8000 \"POST /samples/samples/204/experiment_parameters HTTP/1.1\" 200 893\n"
|
||||
"DEBUG:urllib3.connectionpool:https://localhost:8000 \"POST /samples/samples/204/experiment_parameters HTTP/1.1\" 200 904\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -788,17 +788,17 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"API Response:\n",
|
||||
"run_number=2 type='standard' beamline_parameters=BeamlineParameters(synchrotron='Swiss Light Source', beamline='PXIII', detector=Detector(manufacturer='DECTRIS', model='PILATUS4 2M', type='photon-counting', serial_number='16684dscsd668468', detector_distance_mm=95.0, beam_center_x_px=512.0, beam_center_y_px=512.0, pixel_size_x_um=150.0, pixel_size_y_um=150.0), wavelength=1.0, ring_current_a=0.0, ring_mode='Machine Down', undulator=None, undulatorgap_mm=None, monochromator='Si111', transmission=1.0, focusing_optic='Kirkpatrick-Baez', beamline_flux_at_sample_ph_s=0.0, beam_size_width=30.0, beam_size_height=30.0, characterization=None, rotation=RotationParameters(omega_start_deg=0.0, omega_step=0.1, chi=0.0, phi=10.0, number_of_images=3600, exposure_time_s=0.02), grid_scan=None, jet=None, cryojet_temperature_k=None, humidifier_temperature_k=None, humidifier_humidity=None) dataset=None sample_id=204 id=2\n"
|
||||
"run_number=4 type='standard' beamline_parameters=BeamlineParameters(synchrotron='Swiss Light Source', beamline='PXIII', detector=Detector(manufacturer='DECTRIS', model='PILATUS4 2M', type='photon-counting', serial_number='16684dscsd668468', detector_distance_mm=232.0, beam_center_x_px=768.0, beam_center_y_px=857.0, pixel_size_x_um=150.0, pixel_size_y_um=150.0), wavelength=1.033, ring_current_a=0.4, ring_mode='Machine Development', undulator=None, undulatorgap_mm=None, monochromator='Si111', transmission=10.0, focusing_optic='Kirkpatrick-Baez', beamline_flux_at_sample_ph_s=0.0, beam_size_width=30.0, beam_size_height=30.0, characterization=None, rotation=RotationParameters(omega_start_deg=0.0, omega_step=0.2, chi=0.0, phi=10.0, number_of_images=1800, exposure_time_s=0.01), grid_scan=None, jet=None, cryojet_temperature_k=None, humidifier_temperature_k=None, humidifier_humidity=None) dataset=None sample_id=204 id=6\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 6
|
||||
"execution_count": 18
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-04-30T08:41:33.591843Z",
|
||||
"start_time": "2025-04-30T08:41:33.571527Z"
|
||||
"end_time": "2025-04-30T09:31:29.122855Z",
|
||||
"start_time": "2025-04-30T09:31:29.103718Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@ -806,7 +806,7 @@
|
||||
"from datetime import datetime\n",
|
||||
"\n",
|
||||
"sample_id = sample_id\n",
|
||||
"run_id = 2\n",
|
||||
"run_id = 6\n",
|
||||
"\n",
|
||||
"def test_mark_run_written(sample_id, run_id, configuration):\n",
|
||||
" # Prepare your dataset dict as required by your API (.dict() results if using Pydantic model)\n",
|
||||
@ -840,7 +840,7 @@
|
||||
"DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): localhost:8000\n",
|
||||
"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n",
|
||||
" warnings.warn(\n",
|
||||
"DEBUG:urllib3.connectionpool:https://localhost:8000 \"PATCH /samples/update-dataset/204/2 HTTP/1.1\" 200 1074\n"
|
||||
"DEBUG:urllib3.connectionpool:https://localhost:8000 \"PATCH /samples/update-dataset/204/6 HTTP/1.1\" 200 1085\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -848,11 +848,11 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Dataset updated successfully:\n",
|
||||
"run_number=2 type='standard' beamline_parameters=BeamlineParameters(synchrotron='Swiss Light Source', beamline='PXIII', detector=Detector(manufacturer='DECTRIS', model='PILATUS4 2M', type='photon-counting', serial_number='16684dscsd668468', detector_distance_mm=95.0, beam_center_x_px=512.0, beam_center_y_px=512.0, pixel_size_x_um=150.0, pixel_size_y_um=150.0), wavelength=1.0, ring_current_a=0.0, ring_mode='Machine Down', undulator=None, undulatorgap_mm=None, monochromator='Si111', transmission=1.0, focusing_optic='Kirkpatrick-Baez', beamline_flux_at_sample_ph_s=0.0, beam_size_width=30.0, beam_size_height=30.0, characterization=None, rotation=RotationParameters(omega_start_deg=0.0, omega_step=0.1, chi=0.0, phi=10.0, number_of_images=3600, exposure_time_s=0.02), grid_scan=None, jet=None, cryojet_temperature_k=None, humidifier_temperature_k=None, humidifier_humidity=None) dataset=Datasets(filepath='/das/work/p11/p11206/raw_data/vincent/20250415_6D_SLS2_1st_data/20250415_fullbeam_dtz220_Lyso102_again_360deg', status='written', written_at=datetime.datetime(2025, 4, 30, 10, 41, 33, 572938)) sample_id=204 id=2\n"
|
||||
"run_number=4 type='standard' beamline_parameters=BeamlineParameters(synchrotron='Swiss Light Source', beamline='PXIII', detector=Detector(manufacturer='DECTRIS', model='PILATUS4 2M', type='photon-counting', serial_number='16684dscsd668468', detector_distance_mm=232.0, beam_center_x_px=768.0, beam_center_y_px=857.0, pixel_size_x_um=150.0, pixel_size_y_um=150.0), wavelength=1.033, ring_current_a=0.4, ring_mode='Machine Development', undulator=None, undulatorgap_mm=None, monochromator='Si111', transmission=10.0, focusing_optic='Kirkpatrick-Baez', beamline_flux_at_sample_ph_s=0.0, beam_size_width=30.0, beam_size_height=30.0, characterization=None, rotation=RotationParameters(omega_start_deg=0.0, omega_step=0.2, chi=0.0, phi=10.0, number_of_images=1800, exposure_time_s=0.01), grid_scan=None, jet=None, cryojet_temperature_k=None, humidifier_temperature_k=None, humidifier_humidity=None) dataset=Datasets(filepath='/das/work/p11/p11206/raw_data/vincent/20250415_6D_SLS2_1st_data/20250415_fullbeam_dtz220_Lyso102_again_360deg', status='written', written_at=datetime.datetime(2025, 4, 30, 11, 31, 29, 105136)) sample_id=204 id=6\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 8
|
||||
"execution_count": 19
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
|
Reference in New Issue
Block a user