Pr/84 - #90
Merged
Merged
Pr/84#90
Conversation
Build the ForeFIRE wildfire hazard, register it as a HazardSystem, and return per-timestep perimeter rings (lon/lat) so downstream tools can render and animate fire-front growth.
The vectorized DuckDB fragility evaluator only handled 'norm' and 'lognorm' distributions, silently returning 0.0 failure probability for the 'expon' distribution used by every default fire-boundary-distance curve. As a result no asset could ever be outaged by a fire/ForeFIRE hazard even when it sat inside the burn perimeter. - fragility.py: add an 'expon' branch (single-pass and iterative paths) so fire failure = P_max * exp(-dist / L) with param_1 = L (km), param_2 = P_max, and assets inside the boundary (dist <= 0) are a certain outage (survival 0). - hazard_calcs.py: compute the asset-to-fire distance as a true geodesic distance in km (nearest boundary point via shapely, great-circle via geopy) instead of the DuckDB spatial ST_Distance which returned degrees while being stored as kilometres.
…re decay Two compounding causes made assets fail far from a fire front: 1. The scenario engine drew an independent Bernoulli per timestep and failed an asset if ANY of the ~6-7 ForeFIRE steps tripped, so a modest per-step failure probability compounded (e.g. a pole ~1 km away: 1-0.65^6 ~ 0.75). 2. The default fire decay lengths L were large (0.5-1.1 km). Fixes: - scenario.py (both loop and vectorized generators): evaluate each asset ONCE at its worst exposure (minimum survival across timesteps = the hazard's closest approach) instead of an independent per-timestep draw. - default_fire_boundary_dist.py: tighten L to physical direct-fire-damage ranges (overhead ~0.3 km, substation/transformer ~0.25 km, switch/box ~0.2 km, underground ~0.05 km). Net: a pole 1 km from the front now fails ~3% of the time (was ~75%); >2 km ~0%; inside the boundary still fails with certainty. Verified: ws_smoke errors:[].
Extract _parse_forefire_args, _fire_perimeter_rings, and _format_forefire_result from the monolithic tool handler to address CodeFactor complexity warning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.