Closed mtbc closed 2 years ago
There is a fair bit of copy-and-paste code here. If numba's @jitclass
support were better or it were otherwise easier to inject lambda
s into the heart of propagate
then the four categories - {rectangle, circle} × {slit, beamstop} - could be covered by one piece of code that has a small helper function set by __init__
from float × float → boolean. @ckendrick points to https://stackoverflow.com/questions/52807489/programmatic-nested-numba-cuda-function-calls as possibly presenting an avenue toward that with current numba but I fear that the attendant complication is worse than the current duplication.
... easier to inject
lambda
s into the heart ofpropagate
...
Another issue here may be that the ComponentBase
sets the process kernel class-wide.
Fixes #59 and fixes #62 by adding new
Slit
andBeamstop
components with associated tests.