Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yxqd opened this issue Jun 11, 2023 · 0 comments

Comments

@yxqd
Copy link
Member

yxqd commented Jun 11, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant