Skip to content

Commit ad84844

Browse files
committed
Minor edits
1 parent 61df855 commit ad84844

2 files changed

Lines changed: 24 additions & 18 deletions

File tree

src/murfey/client/contexts/spa.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -377,39 +377,43 @@ def _position_analysis(
377377
capture_post(
378378
base_url=str(environment.url.geturl()),
379379
router_name="session_control.spa_router",
380-
function_name="register_foil_hole",
380+
function_name="register_foil_holes",
381381
token=self._token,
382382
instrument_name=environment.instrument_name,
383383
session_id=environment.murfey_session,
384384
gs_name=grid_square,
385385
data={
386-
"name": foil_hole,
387-
"x_location": fh.x_location,
388-
"y_location": fh.y_location,
389-
"x_stage_position": fh.x_stage_position,
390-
"y_stage_position": fh.y_stage_position,
391-
"readout_area_x": fh.readout_area_x,
392-
"readout_area_y": fh.readout_area_y,
393-
"thumbnail_size_x": fh.thumbnail_size_x,
394-
"thumbnail_size_y": fh.thumbnail_size_y,
395-
"pixel_size": fh.pixel_size,
396-
"diameter": fh.diameter,
397-
"tag": str(source),
398-
"image": str(image_path),
386+
str(foil_hole): {
387+
"name": foil_hole,
388+
"x_location": fh.x_location,
389+
"y_location": fh.y_location,
390+
"x_stage_position": fh.x_stage_position,
391+
"y_stage_position": fh.y_stage_position,
392+
"readout_area_x": fh.readout_area_x,
393+
"readout_area_y": fh.readout_area_y,
394+
"thumbnail_size_x": fh.thumbnail_size_x,
395+
"thumbnail_size_y": fh.thumbnail_size_y,
396+
"pixel_size": fh.pixel_size,
397+
"diameter": fh.diameter,
398+
"tag": str(source),
399+
"image": str(image_path),
400+
}
399401
},
400402
)
401403
else:
402404
capture_post(
403405
base_url=str(environment.url.geturl()),
404406
router_name="session_control.spa_router",
405-
function_name="register_foil_hole",
407+
function_name="register_foil_holes",
406408
token=self._token,
407409
instrument_name=environment.instrument_name,
408410
session_id=environment.murfey_session,
409411
gs_name=grid_square,
410412
data={
411-
"name": foil_hole,
412-
"tag": str(source),
413+
str(foil_hole): {
414+
"name": foil_hole,
415+
"tag": str(source),
416+
}
413417
},
414418
)
415419
self._foil_holes[grid_square].append(foil_hole)

src/murfey/server/api/session_control.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,9 @@ def register_foil_holes(
487487
"register": "spa.register_foil_holes",
488488
"session_id": session_id,
489489
"gs_name": gs_name,
490-
"foil_hole_group": foil_hole_group,
490+
"foil_hole_group": {
491+
k: v.model_dump() for k, v in foil_hole_group.items()
492+
},
491493
},
492494
)
493495
return gs_name

0 commit comments

Comments
 (0)