Skip to content

Commit 7228715

Browse files
committed
Set attributes of the environment if they exist
1 parent c81d7da commit 7228715

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/murfey/instrument_server/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ def register_processing_parameters(
329329
controllers[session_id].data_collection_parameters.update(
330330
data_collection_parameters[proc_param_block.label]
331331
)
332+
for k, v in proc_param_block.params.dict().items():
333+
if v is not None and hasattr(controllers[session_id]._environment, k):
334+
setattr(controllers[session_id]._environment, k, v)
332335
return {"success": True}
333336

334337

src/murfey/util/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class RsyncerInfo(BaseModel):
7777

7878
class ProcessingParametersSPA(BaseModel):
7979
tag: str
80-
dose_per_frame: float
80+
dose_per_frame: Optional[float]
8181
gain_ref: Optional[str]
8282
experiment_type: str
8383
voltage: float

0 commit comments

Comments
 (0)