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

show latest kalman_watch plotly plot with STK radiation model #34

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

javierggt
Copy link
Contributor

@javierggt javierggt commented Sep 20, 2024

Description

After kalman_watch 0.6.0 (after sot/kalman_watch/pull/16), the IR flag fraction plot will be a plotly plot, and not PNG. This PR changes the web scraper to show the new plot.

Interface impacts

Testing

Unit tests

  • No unit tests

Functional tests

Not clear what is the best way to test, because everything is hardwired to the flight values.

I did the following:

from twiki_wg import ssawg_trending_scraper
class KalmanWatch3Page(ssawg_trending_scraper.KalmanWatch3Page):
    def get_url(self):
        return f"https://icxc.cfa.harvard.edu/aspect/test_review_outputs/kalman_watch/pr-16/yearly/", ""
page = KalmanWatch3Page()
page.parse_page()
chunks = page.get_html_chunks()

and checked that each of the chunks corresponds to the right element on the page.

@javierggt
Copy link
Contributor Author

While doing this PR, I realized that the scraping can fail if something changes in plotly at some point (but hopefully it won’t). Still, it would be good to keep it in mind.

The scraping relies on the list of div elements, but that is a straight list, whereas divs come in a tree. Currently, each plotly plot contributes two div elements. If they decide to add another nested div, that will change the count and the wrong info will be displayed instead of the second plot in the kalman watch section.

@jeanconn
Copy link
Contributor

I think the twiki-wg scraping code is not easily-maintainable code and we're continuing to use it knowing full well that it is brittle. I suppose I would wonder if there is a nice way to do some sanity check on the div it grabs for the plotly plot and have twiki-wg throw an error if it doesn't find what it is looking for (because in SSAWG we might miss that we're just getting an empty div or the like in review)? but that would be a twiki-wg "desirement" not required in this PR.

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.

The noted functional testing looks good for this application.

@javierggt
Copy link
Contributor Author

javierggt commented Sep 20, 2024

anyway, I was prompted by your comment to produce a script to check the whole thing (PR #35 ).

@javierggt javierggt merged commit 117de2c into master Sep 20, 2024
2 checks passed
@javierggt javierggt deleted the kalman-watch-stk branch September 20, 2024 16:57
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