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

Critical Hours #3849

Merged
merged 48 commits into from
Sep 5, 2024
Merged

Critical Hours #3849

merged 48 commits into from
Sep 5, 2024

Conversation

dgboss
Copy link
Collaborator

@dgboss dgboss commented Aug 14, 2024

  • Critical hours are calculated for each station within a fire zone unit. A representative start and end time is then selected for the fire zone unit.
  • Critical hours are saved in a new critical_hours table.
  • This is a temporary implementation that will be replaced once we are able to perform critical hours calculations spatially. As this is temporary there are no tests.
  • A lot of functionality is borrowed/copied from FireBat.
  • Back-end work only. API endpoint and front-end integration coming soon!

Test Links:

Landing Page
MoreCast
Percentile Calculator
C-Haines
FireBat
FireBat bookmark
Auto Spatial Advisory (ASA)
HFI Calculator

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 70.37037% with 8 lines in your changes missing coverage. Please review.

Project coverage is 79.67%. Comparing base (30f0c07) to head (cfd4872).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
api/app/utils/geospatial.py 38.46% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3849      +/-   ##
==========================================
- Coverage   79.70%   79.67%   -0.03%     
==========================================
  Files         293      293              
  Lines       10863    10888      +25     
  Branches      517      517              
==========================================
+ Hits         8658     8675      +17     
- Misses       2063     2071       +8     
  Partials      142      142              

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

@dgboss dgboss changed the title Task/critical hours/3746 Critical Hours Aug 14, 2024
)


def test_check_station_invalid_missing_daily():
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It looks like this test might also be checking for missing hourly instead of missing dailies?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated tests, hopefully they read more clearly now.

Co-authored-by: dgboss <darren.boss@gov.bc.ca>


@dataclass(frozen=True)
class CriticalHoursInputs:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

❤️

Copy link
Collaborator Author

@dgboss dgboss left a comment

Choose a reason for hiding this comment

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

I can't actually approve this as I opened the original PR, but I think it looks good with your changes. Thanks again for picking this up!

Copy link
Collaborator

@brettedw brettedw left a comment

Choose a reason for hiding this comment

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

Nice work to both of you!

Copy link

sonarcloud bot commented Sep 5, 2024

@conbrad conbrad temporarily deployed to production September 5, 2024 19:57 Inactive
@conbrad conbrad temporarily deployed to production September 5, 2024 20:18 Inactive
@conbrad conbrad merged commit 3d1486a into main Sep 5, 2024
30 checks passed
@conbrad conbrad deleted the task/critical-hours/3746 branch September 5, 2024 20:36
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