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

Use limits from the JSON file, refactor prediction plots #45

Merged
merged 21 commits into from
Jan 26, 2022

Conversation

jzuhone
Copy link
Member

@jzuhone jzuhone commented Dec 28, 2021

Description

This PR includes two refactors for acis_thermal_check and a bug fix.

  1. Use limits from the JSON file

In sot/chandra_models#75 limit information was added to the model specification JSON files. In sot/xija#112 the ability to select a default color based on a limit was added. This PR uses both of these pieces of functionality in acis_thermal_check. This means that the limit information no longer needs to reside in a separate place in the limits.yml file. The limits also had to be added to the test JSON files for the regression testing suite.

  1. Refactor prediction plotting

This PR also includes a refactor of prediction plotting. For making the prediction plots, we had been using two legacy functions, plot_one and plot_two, the first of which plotted one quantity (e.g. the temperature) on the left y-axis only, and the second of which added another quantity (e.g. the pitch) on the right y-axis. Much of the code between these two functions was duplicated. Also, these plots were handled internally and passed to the code which makes the web page through dictionaries, which creates quite a bit of extra code from the use of indexing the dicts. I have merged the functionalities of plot_one and plot_two into a new PredictPlot class, which also stores everything that was in a dict before as attributes, such as the Matplotlib Figure and Axes for the plot. This results in code which is much shorter and cleaner. I also added a method for this new class, add_limit_line, for adding a limit line to the plot to reduce code duplication.

This lays the groundwork for doing a similar thing later for the validation plots, but to avoid making this PR even larger I'll hold off on that for now.

  1. This PR also fixes a bug which included obsids in the list of observations which are permitted to go to -109 C which are not part of the load under review.

Testing

  • Passes unit tests on MacOS, linux, Windows (at least one required)
  • Functional testing

@jzuhone jzuhone changed the title Use limits from the JSON file Use limits from the JSON file, refactor prediction plots Jan 5, 2022
@jzuhone
Copy link
Member Author

jzuhone commented Jan 19, 2022

@Gregg140 @jazan12 just a reminder that this needs looked at

Copy link

@jazan12 jazan12 left a comment

Choose a reason for hiding this comment

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

Included a few minor and superficial notes for you to check but looks good to me.

@jazan12
Copy link

jazan12 commented Jan 25, 2022 via email

@jzuhone jzuhone merged commit f3eae05 into acisops:master Jan 26, 2022
@jzuhone jzuhone mentioned this pull request Jan 27, 2022
2 tasks
@jzuhone jzuhone deleted the json_limits branch February 23, 2022 22:08
@javierggt javierggt mentioned this pull request Aug 3, 2022
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.

3 participants