File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,11 @@ def register_dc_group(
100100 .where (DataCollectionGroup .session_id == session_id )
101101 .where (DataCollectionGroup .tag == dcg_params .tag )
102102 ).all ():
103- dcg_murfey [0 ].atlas = dcg_params .atlas
104- dcg_murfey [0 ].sample = dcg_params .sample
105- dcg_murfey [0 ].atlas_pixel_size = dcg_params .atlas_pixel_size
103+ dcg_murfey [0 ].atlas = dcg_params .atlas or dcg_murfey [0 ].atlas
104+ dcg_murfey [0 ].sample = dcg_params .sample or dcg_murfey [0 ].sample
105+ dcg_murfey [0 ].atlas_pixel_size = (
106+ dcg_params .atlas_pixel_size or dcg_murfey [0 ].atlas_pixel_size
107+ )
106108
107109 if _transport_object :
108110 if dcg_murfey [0 ].atlas_id is not None :
@@ -114,6 +116,8 @@ def register_dc_group(
114116 "atlas" : dcg_params .atlas ,
115117 "sample" : dcg_params .sample ,
116118 "atlas_pixel_size" : dcg_params .atlas_pixel_size ,
119+ "dcgid" : dcg_murfey [0 ].id ,
120+ "session_id" : session_id ,
117121 },
118122 )
119123 else :
Original file line number Diff line number Diff line change @@ -2032,6 +2032,16 @@ def feedback_callback(header: dict, message: dict) -> None:
20322032 message ["sample" ],
20332033 )
20342034 murfey .server ._transport_object .transport .ack (header )
2035+ if dcg_hooks := entry_points ().select (
2036+ group = "murfey.hooks" , name = "data_collection_group"
2037+ ):
2038+ try :
2039+ for hook in dcg_hooks :
2040+ hook .load ()(message ["dcgid" ], session_id = message ["session_id" ])
2041+ except Exception :
2042+ logger .error (
2043+ "Call to data collection group hook failed" , exc_info = True
2044+ )
20352045 return None
20362046 elif message ["register" ] == "data_collection" :
20372047 logger .debug (
You can’t perform that action at this time.
0 commit comments