Skip to content

Pr/84 - #90

Merged
AadilLatif merged 5 commits into
mainfrom
pr/84
Jul 30, 2026
Merged

AadilLatif merged 5 commits into
mainfrom
pr/84

Conversation

@AadilLatif

Copy link
Copy Markdown
Collaborator

No description provided.

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.
@AadilLatif
AadilLatif merged commit da51ef3 into main Jul 30, 2026
3 checks passed
@AadilLatif
AadilLatif deleted the pr/84 branch July 30, 2026 17: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.

1 participant