This updates the ComponentBase class to allow float type switching, as well as enforcing the existence of a propagate method in subclasses.
Major changes include:
The propagate method is now defined from within component classes as opposed to outside them. Subclasses must define this method, or else an error will be raised.
Components no longer need to explicitly register a propagate method , and instead just have to call super().__init__(__class__, **kwargs) from within the Component subclass __init__ method.
03232022: requirement of calling super().__init__ was removed. It is now done by the metaclass
Components can now accept a floattype argument passed in as **kwargs. This can be either "float64" (default), or "float32".
03232022: components can change floattype by ComponentClass.change_floattype(newtype)
The propagate method must define a signature in its @cuda.jit decorator. If not, this will raise an error. This signature can use the default float type ("float64") without needing to specify "float32" - this will be automatically converted on-the-fly when needed.
All currently existing components have been updated for these new changes: Arm, Beamstop, DivPos_Monitor, Guide, Guide_tapering, Slit, Source_simple, and Wavelength_Monitor
This updates the
ComponentBase
class to allow float type switching, as well as enforcing the existence of apropagate
method in subclasses.Major changes include:
propagate
method is now defined from within component classes as opposed to outside them. Subclasses must define this method, or else an error will be raised., and instead just have to callsuper().__init__(__class__, **kwargs)
from within the Component subclass__init__
method.super().__init__
was removed. It is now done by the metaclassComponents can now accept afloattype
argument passed in as**kwargs
. This can be either "float64" (default), or "float32".ComponentClass.change_floattype(newtype)
propagate
method must define a signature in its@cuda.jit
decorator. If not, this will raise an error. This signature can use the default float type ("float64") without needing to specify "float32" - this will be automatically converted on-the-fly when needed.All currently existing components have been updated for these new changes:
Arm
,Beamstop
,DivPos_Monitor
,Guide
,Guide_tapering
,Slit
,Source_simple
, andWavelength_Monitor