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

PREOPS-4518: Preserve wind and seeing conditions from a loaded pickle. #47

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

alserene
Copy link
Collaborator

@alserene alserene commented Nov 7, 2023

No description provided.

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (fd39cf9) 12.19% compared to head (1385421) 12.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
+ Coverage   12.19%   12.51%   +0.32%     
==========================================
  Files          39       39              
  Lines        3156     3171      +15     
  Branches      477      477              
==========================================
+ Hits          385      397      +12     
- Misses       2762     2765       +3     
  Partials        9        9              
Files Coverage Δ
tests/test_scheduler_dashboard.py 98.00% <100.00%> (+0.27%) ⬆️
...iew/app/scheduler_dashboard/scheduler_dashboard.py 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@ehneilsen ehneilsen left a comment

Choose a reason for hiding this comment

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

Provided that update_conditions does not get called when a new pickle is loaded, this looks fine. (After a pickle is loaded but before the user sets a new time, the conditions instance that should be being used is the one from the pickle, not one generated by the dashboard's instance of ModelObservatory. I think that's what you've done, but I'm not 100% sure. One challenge with param is that it's sometimes hard to tell what triggers what.)

)

# Code for tickets/PREOPS-4817
Copy link
Collaborator

Choose a reason for hiding this comment

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

In general, if code has previously been checked into git, just deleting it rather than commenting it is usually a better approach, although a text comment describing why one approach was taken rather than the other, maybe mentioning the commit where the other approach was taken, can be quite useful. Usually, "why" comments are more useful for posterity than "what" comments. (There are, of course, exceptions to this rule of thumb.)

(Just because I know this is good advice doesn't mean I actually always follow it myself, but I should.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, update_conditions only gets called when the date is changed 👍

The commented code is actually for the next ticket related to this, ticket 3817, allowing users to set weather conditions. (I realise now I've written the ticket number wrong.) I'll just remove the commented code and store in a file on my computer somewhere instead.

@emanehab99
Copy link
Collaborator

Looks good! Thanks for updating the tests

@alserene alserene merged commit 8b35b18 into main Nov 8, 2023
7 checks passed
@alserene alserene deleted the tickets/PREOPS-4518 branch November 8, 2023 04:18
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