-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implementation and tests for TPI stats endpoints #3838
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3838 +/- ##
==========================================
+ Coverage 79.31% 79.47% +0.15%
==========================================
Files 295 295
Lines 10874 10887 +13
Branches 518 518
==========================================
+ Hits 8625 8652 +27
+ Misses 2105 2091 -14
Partials 144 144 ☔ View full report in Codecov by Sentry. |
api/app/routers/fba.py
Outdated
stats = await get_zonal_tpi_stats(session, fire_zone_id, run_type, run_datetime, for_date) | ||
return FireZoneTPIStats( | ||
fire_zone_id=fire_zone_id, | ||
valley_bottom=stats.valley_bottom * stats.pixel_size_metres, |
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.
Is pixel size stored as area? Or a 1-D length? If the latter, then we might want to square the pixel size.
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.
Ultimately it might not matter as we're just displaying percentages in the frontend, not absolute values.
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.
You're right it's 1-D length, I'll square it. Otherwise it may be confusing in the future / if another consumer uses the endpoint.
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.
Done in: a8517bc
Quality Gate passedIssues Measures |
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.
Looks great!
- Adds TPI stats endpoint that returns the (assumed) single record for TPI stats for a specific run time and run parameters - Since TPI stats are counts of cells that hit HFI > 4k for each classification, this is returned as an area, count * pixel size in metres - Adds tests for authenticated and unauthenticated endpoint calls - Removes unnecessary mock JWT with roles in test suite
- Adds TPI stats endpoint that returns the (assumed) single record for TPI stats for a specific run time and run parameters - Since TPI stats are counts of cells that hit HFI > 4k for each classification, this is returned as an area, count * pixel size in metres - Adds tests for authenticated and unauthenticated endpoint calls - Removes unnecessary mock JWT with roles in test suite
Test Links:
Landing Page
MoreCast
Percentile Calculator
C-Haines
FireBat
FireBat bookmark
Auto Spatial Advisory (ASA)
HFI Calculator