Skip to content

Commit 547956b

Browse files
committed
Allow updates to be made to data collection group experiment type
1 parent 289111e commit 547956b

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

src/murfey/server/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2575,6 +2575,8 @@ def feedback_callback(header: dict, message: dict) -> None:
25752575
message["atlas"],
25762576
message["atlas_pixel_size"],
25772577
message["sample"],
2578+
experiment_type=message["experiment_type"],
2579+
experiment_type_id=message["experiment_type_id"],
25782580
)
25792581
_transport_object.transport.ack(header)
25802582
return None

src/murfey/server/api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,8 @@ def register_dc_group(
13271327
"atlas": dcg_params.atlas,
13281328
"sample": dcg_params.sample,
13291329
"atlas_pixel_size": dcg_params.atlas_pixel_size,
1330+
"experiment_type": dcg_params.experiment_type,
1331+
"experiment_type_id": dcg_params.experiment_type_id,
13301332
},
13311333
)
13321334
else:

src/murfey/server/ispyb.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,28 @@ def do_insert_atlas(self, record: Atlas):
115115
return {"success": False, "return_value": None}
116116

117117
def do_update_atlas(
118-
self, atlas_id: int, atlas_image: str, pixel_size: float, slot: int
118+
self,
119+
atlas_id: int,
120+
atlas_image: str,
121+
pixel_size: float,
122+
slot: int,
123+
experiment_type: str = "",
124+
experiment_type_id: Optional[int] = None,
119125
):
120126
try:
121127
with Session() as db:
122128
atlas = db.query(Atlas).filter(Atlas.atlasId == atlas_id).one()
129+
dcg = (
130+
db.query(DataCollectionGroup)
131+
.filter(
132+
DataCollectionGroup.dataCollectionGroupId
133+
== atlas.dataCollectionGroupId
134+
)
135+
.one()
136+
)
137+
if experiment_type and experiment_type_id is not None:
138+
dcg.experimentTypeId = experiment_type_id
139+
db.add(dcg)
123140
atlas.atlasImage = atlas_image or atlas.atlasImage
124141
atlas.pixelSize = pixel_size or atlas.pixelSize
125142
atlas.cassetteSlot = slot or atlas.cassetteSlot

0 commit comments

Comments
 (0)