Skip to content

Commit 6fc82bd

Browse files
authored
Update ISPyB Inserts (#693)
* Insert CLEM data with correct experiment type ID * Removed the insertion of 'experiment_type_id' into DataCollectionGroup tables due to deprecation of the field * Add CLEM and FIB experiment type IDs to ISPyB test database
1 parent e292f91 commit 6fc82bd

File tree

10 files changed

+10
-20
lines changed

10 files changed

+10
-20
lines changed

src/murfey/client/contexts/spa_metadata.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ def post_transfer(
177177
return
178178
dcg_tag = str(dcg_images_dirs[-1])
179179
dcg_data = {
180-
"experiment_type": "single particle",
181-
"experiment_type_id": 37,
180+
"experiment_type_id": 37, # Single particle
182181
"tag": dcg_tag,
183182
"atlas": str(
184183
_atlas_destination(
@@ -248,8 +247,7 @@ def post_transfer(
248247
return
249248
dcg_tag = str(dcg_images_dirs[-1])
250249
dcg_data = {
251-
"experiment_type": "single particle",
252-
"experiment_type_id": 37,
250+
"experiment_type_id": 37, # Single particle
253251
"tag": dcg_tag,
254252
}
255253
capture_post(

src/murfey/client/contexts/tomo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ def register_tomography_data_collections(
102102
return
103103
try:
104104
dcg_data = {
105-
"experiment_type": "tomo",
106-
"experiment_type_id": 36,
105+
"experiment_type_id": 36, # Tomo
107106
"tag": str(self._basepath),
108107
"atlas": "",
109108
"sample": None,

src/murfey/client/contexts/tomo_metadata.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def ensure_dcg_exists(
2222
return None
2323
dcg_tag = str(source).replace(f"/{environment.visit}", "")
2424
dcg_data = {
25-
"experiment_type": "tomo",
26-
"experiment_type_id": 36,
25+
"experiment_type_id": 36, # Tomo
2726
"tag": dcg_tag,
2827
}
2928
capture_post(
@@ -107,8 +106,7 @@ def post_transfer(
107106
p for p in transferred_file.parent.parts if p != environment.visit
108107
).replace("//", "/")
109108
dcg_data = {
110-
"experiment_type": "tomo",
111-
"experiment_type_id": 36,
109+
"experiment_type_id": 36, # Tomo
112110
"tag": dcg_tag,
113111
"atlas": str(
114112
_atlas_destination(

src/murfey/client/multigrid_control.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,7 @@ def _start_dc(self, metadata_json, from_form: bool = False):
611611

612612
elif isinstance(context, SPAModularContext):
613613
dcg_data = {
614-
"experiment_type": "single particle",
615-
"experiment_type_id": 37,
614+
"experiment_type_id": 37, # Single particle
616615
"tag": str(source),
617616
"atlas": (
618617
str(self._environment.samples[source].atlas)

src/murfey/client/tui/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,7 @@ def _start_dc(self, metadata_json, from_form: bool = False):
562562
log.info("Tomography processing flushed")
563563
elif isinstance(context, SPAModularContext):
564564
dcg_data = {
565-
"experiment_type": "single particle",
566-
"experiment_type_id": 37,
565+
"experiment_type_id": 37, # Single particle
567566
"tag": str(source),
568567
"atlas": (
569568
str(self._environment.samples[source].atlas)

src/murfey/server/api/workflow.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383

8484
class DCGroupParameters(BaseModel):
8585
# DC = Data collection
86-
experiment_type: str
8786
experiment_type_id: int
8887
tag: str
8988
atlas: str = ""
@@ -159,7 +158,6 @@ def register_dc_group(
159158
else:
160159
dcg_parameters = {
161160
"start_time": str(datetime.now()),
162-
"experiment_type": dcg_params.experiment_type,
163161
"experiment_type_id": dcg_params.experiment_type_id,
164162
"tag": dcg_params.tag,
165163
"session_id": session_id,

src/murfey/workflows/clem/register_preprocessing_results.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ def _register_dcg_and_atlas(
225225
"visit_number": visit_number,
226226
"session_id": session_id,
227227
"tag": dcg_name,
228-
"experiment_type": "experiment",
229-
"experiment_type_id": None,
228+
"experiment_type_id": 45,
230229
"atlas": atlas_name,
231230
"atlas_pixel_size": atlas_pixel_size,
232231
"sample": None,

src/murfey/workflows/register_data_collection_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def run(
4747
else:
4848
record = ISPyBDB.DataCollectionGroup(
4949
sessionId=ispyb_session_id,
50-
experimentType=message["experiment_type"],
5150
experimentTypeId=message["experiment_type_id"],
5251
)
5352

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ class ISPyBTableValues:
116116
"Tomography": 36,
117117
"Single Particle": 37,
118118
"Atlas": 44,
119+
"CLEM": 45,
120+
"FIB": 46,
119121
}
120122

121123

tests/workflows/test_register_data_collection_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def test_run(
6666
"visit_number": ExampleVisit.visit_number,
6767
"session_id": ExampleVisit.murfey_session_id,
6868
"tag": "some_text",
69-
"experiment_type": "single particle",
7069
"experiment_type_id": 0,
7170
"atlas": "some_file",
7271
"atlas_pixel_size": 1e-9,

0 commit comments

Comments
 (0)