Closed gurhar1133 closed 1 year ago
Refactored CrystalSlice propagation. Different propagation methods are now private and invoked by calling .propagate(pulse, prop_type) using dictionary dispatch eg below
.propagate(pulse, prop_type)
def propagate(self, laser_pulse, prop_type): return PKDict( attenuate=self._propagate_attenuate, placeholder=self._propagate_placeholder, abcd_lct=self._propagate_abcd_lct, n0n2_lct=self._propagate_n0n2_lct, n0n2_srw=self._propagate_n0n2_srw, default=super().propagate, )[prop_type](laser_pulse)
Now any new propagation method can be written as a private method and then called by propagate through a new entry into the PKDict
Refactored CrystalSlice propagation. Different propagation methods are now private and invoked by calling
.propagate(pulse, prop_type)
using dictionary dispatch eg belowNow any new propagation method can be written as a private method and then called by propagate through a new entry into the PKDict