Add validations and logging for puck beamtime assignment.
Introduced checks to prevent reassigning beamtime if puck samples have recorded events. Updated logging in beamline-related methods to provide more insight. Simplified data structure updates for dewars, pucks, and samples, ensuring consistency with beamtime assignments.
This commit is contained in:
@ -709,9 +709,18 @@ dewar_to_beamtime = {
|
||||
for dewar in dewars # Or use actual beamtime ids
|
||||
}
|
||||
|
||||
# Update dewars and their pucks with consistent beamtime
|
||||
for dewar in dewars:
|
||||
dewar.beamtime_id = dewar_to_beamtime[dewar.id]
|
||||
assigned_beamtime_obj = next(
|
||||
b for b in beamtimes if b.id == dewar_to_beamtime[dewar.id]
|
||||
)
|
||||
dewar.beamtimes = [assigned_beamtime_obj]
|
||||
|
||||
for puck in pucks:
|
||||
assigned_beamtime_obj = next(
|
||||
b for b in beamtimes if b.id == dewar_to_beamtime[puck.dewar_id]
|
||||
)
|
||||
puck.beamtimes = [assigned_beamtime_obj]
|
||||
|
||||
|
||||
for puck in pucks:
|
||||
dewar_id = puck.dewar_id # Assuming puck has dewar_id
|
||||
|
Reference in New Issue
Block a user