mcvine / acc

Accelerated mcvine engine
0 stars 1 forks source link

refactor run_script so that it works with instrument script that uses on the fly components #112

Open yxqd opened 1 year ago

yxqd commented 1 year ago

Currently run_script imports the component classes for an instrument, assuming each component in the instrument comes from a static component class. The limitation comes from the fact that it imports the component classes in the "compiled" instrument script. For example:

from mcvine.acc.components.sources.source_simple import Source_simple as comp0
from HSS_isotropic_sphere import HSS as comp1

propagate0 = comp0.propagate
propagate1 = comp1.propagate

If the component was created from a factory method, the component class may have been generated on the fly. Should improve the run_script to support these kind of components