-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Using in-place list operations (append(), extend()) to modify the Simulate.params property leads to an AttributeError when run() is called. My suspicion is this happens because the operations bypass the parameter extraction/validation.
Result of calling run() after using params.append() or params.extend():
File ~/git-repos/raypyng/src/raypyng/simulate.py:611, in Simulate._save_parameters_to_file(self, dir)
603 def _save_parameters_to_file(self, dir):
604 """Save user input parameters to file.
605
606 It takes the values from the SimulationParams class
(...)
609 dir (str): the folder where to save the parameters
610 """
--> 611 for i, p in enumerate(self.sp.ind_par):
612 filename = str(p.get_full_path().lstrip("lab.beamline."))
613 filename = "input_param_"+filename.replace(".", "_")
AttributeError: 'NoneType' object has no attribute 'ind_par'
Note: This issue probably existed prior to merge of pull request #31, but it was masked by the error being thrown by the params getter (#29).
Also note: Simulate.exports does not suffer from this problem.
Metadata
Metadata
Assignees
Labels
No labels