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

WIP: Allow aca limits to be missing from the model spec file #383

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions proseco/characteristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,11 @@ def _set_aca_limits():
names = ("aca_t_ccd_penalty_limit", "aca_t_ccd_planning_limit")
spec_names = ("planning.penalty.high", "planning.warning.high")
for name, spec_name in zip(names, spec_names):
try:
limit = spec["limits"]["aacccdpt"][spec_name]
except KeyError:
raise KeyError(
f"unable to find ['limits']['aacccdpt']['{spec_name}'] "
"in the ACA xija model in "
f"chandra_models version {chandra_models_version}."
)
else:
globals()[name] = limit
globals()[name] = (
spec["limits"]["aacccdpt"][spec_name]
if spec_name in spec["limits"]["aacccdpt"]
else None
)


# Make sure module-level `dir()` includes the lazy attributes.
Expand Down