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

Make inputs work if dependent on later input items #1239

Merged
merged 3 commits into from
Aug 31, 2023
Merged

Conversation

rmjarvis
Copy link
Member

@rmjarvis rmjarvis commented Aug 18, 2023

imSim has input types that depend on other input types. Most notably, many things implicitly depend on opsim_data, which is basically a dict with a bunch of values that things need. If the inputs are listed in order with dependencies first, everything is fine. But when using recursive templates, this can be difficult to get right. Currently, that causes the input items that are dependent on later ones not to load properly. The most critical of these is atm_psf, which needs to be loaded at the start to only build one set of atmospheric screens for all the CCDs to use. cf. LSSTDESC/imSim#408

In this PR, when loading an input object, if it raises an exception that indicates it needs a different input type, it tries to load that one first before continuing on.

@rmjarvis rmjarvis added this to the v2.5 milestone Aug 18, 2023
@rmjarvis rmjarvis added config Related to the config-processing functionality. desc Of possible interest to LSST DESC members looking for a project labels Aug 18, 2023
Copy link
Member

@jmeyers314 jmeyers314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one looks good too.

@rmjarvis rmjarvis merged commit 8e1f213 into main Aug 31, 2023
9 checks passed
@rmjarvis rmjarvis deleted the recursive_inputs branch August 31, 2023 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Related to the config-processing functionality. desc Of possible interest to LSST DESC members looking for a project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants