Bugfix for Stage.get_driver_source()#179
Conversation
…ds to take into consideration.
kyrsjo
left a comment
There was a problem hiding this comment.
Overall driver_source logic is weird and inconsistent.
Why is the logic to test driver_source in get_driver_source and not in the property setter? Why is get_driver_source applying extra tests on top of what the property getter/setter is doing (and why is this even necessary, instead of just testing the object type when setting the object?
|
TODO: also rename |
…rce energy from Stage.get_driver_source() to Stage.driver_source setter.
… for valid driver source instances and energy.
… to test for valid driver source instances and energy.
… to test for valid driver source instances and energy.
… for valid driver source instances and energy.
…iver_source in abel/classes/stage/stage.py.
…on in the check for driver source energy if the driver source is a SourceCapsule.
…c.py to use the parent class driver source setter.
…istatic_2d.py to use the parent class driver source setter.
…ced_models.py to use the parent class driver source setter.
…_t.py to use the parent class driver source setter.
kyrsjo
left a comment
There was a problem hiding this comment.
Nice! One comment, why is the driver_source setters and getters duplicated in the implementations? Is it just to set the align_beam_axis to true?
Btw couldn't you use self.get_actual_driver_source().align_beam_axis for this?
The driver source setters are overloaded in the implementations to always set |
|
Two more questions. |
…l_driver_source().
…et_actual_driver_source().
…et_actual_driver_source().
…l_driver_source().
Added some scenarios to
Stage.get_driver_source()that the method needs to take into consideration.