-
Notifications
You must be signed in to change notification settings - Fork 0
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 a NERSC status checker. #183
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
==========================================
+ Coverage 51.79% 52.04% +0.24%
==========================================
Files 35 36 +1
Lines 2475 2521 +46
==========================================
+ Hits 1282 1312 +30
- Misses 1193 1209 +16 ☔ View full report in Codecov by Sentry. |
if ac.status != StatusValue.active: | ||
outages = await self._cli.resources.outages(ac.name) | ||
for o in outages: | ||
if o.status == "Active": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if o.status == "Active": | |
if o.status == StatusValue.active: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't actually an enum in the client, although It could be. If it were, though, it'd be a different enum than StatusValue as the values are different - even "Active" has different capitalization
if self.perlmutter_available and self.dtns_available: | ||
return max(self.perlmutter_available, self.dtns_available) | ||
return self.dtns_available if self.dtns_available else self.perlmutter_available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.perlmutter_available and self.dtns_available: | |
return max(self.perlmutter_available, self.dtns_available) | |
return self.dtns_available if self.dtns_available else self.perlmutter_available | |
return max(self.perlmutter_available or 0, self.dtns_available or 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The *_available
instance variables are datetime
s and therefore trying to compare them to int
s fails. I thought about using datetime.min
instead, but that would require checking for that value and replacing it with None
, so it requires using a magic value, which I'm not a fan of, and doesn't make the code all that less complex. So for now I'm leaving it as is, but as a consolation prize I wrote tests for if we want to refactor later.
No description provided.