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

Add test of optional ACA limits #385

Merged
merged 2 commits into from
Aug 15, 2023
Merged

Add test of optional ACA limits #385

merged 2 commits into from
Aug 15, 2023

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Aug 15, 2023

Description

This adds a unit test that verifiers the functionality in #384.

As a small out-of-scope change, move to matplotlib.pyplot.switch_backend to avoid the linting problem with imports after code.

Interface impacts

None.

Testing

Unit tests

  • Mac

Independent check of unit tests by Jean

  • Linux

Functional tests

No functional testing.

@taldcroft taldcroft requested a review from jeanconn August 15, 2023 14:45
@taldcroft
Copy link
Member Author

@jeanconn - please approve if you are good with this.

@jeanconn
Copy link
Contributor

jeanconn commented Aug 15, 2023

I eye-balled the new git and model fetching and manipulation but haven't had a chance to do review on this yet.

@taldcroft
Copy link
Member Author

Ah OK, I misinterpreted the scope of "This seems fine". No problem.

_test_optional_penalty_limit()
finally:
# Reset ACA limits characteristics that get set above
ACA._set_aca_limits()
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, so real testing question -- this makes sense but would there be other advantages to using a fixture to do this instead? Or have you not used a fixture because you prefer to explicitly test that ACA._set_aca_limits gets back to the 3.48 values?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't exactly sure how to do this with a fixture and decided this was good enough.

Copy link
Contributor

@jeanconn jeanconn left a comment

Choose a reason for hiding this comment

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

Looks good. The business with manually running ACA._set_aca_limits() to override the proseco "cache" and lazy load for these attributes reminded me... should proseco also be using @chandra_models.chandra_models_cache to get the model?

@taldcroft
Copy link
Member Author

taldcroft commented Aug 15, 2023

should proseco also be using @chandra_models.chandra_models_cache to get the model?

Good point. I think something like this can work and be a good thing. Next PR... #386

@taldcroft taldcroft merged commit 07db67a into master Aug 15, 2023
@taldcroft taldcroft deleted the optional-aca-limits-test branch August 15, 2023 18:59
@javierggt javierggt mentioned this pull request Sep 6, 2023
@javierggt javierggt mentioned this pull request Sep 18, 2023
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

Successfully merging this pull request may close these issues.

2 participants