-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/3d ignition mask #13
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
Conversation
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.
Pull Request Overview
This PR enables stochastic ignition scenario simulation by allowing 3D ignition masks for per-realization ignition points instead of only 2D masks. The key changes include updating the ignition mask handling logic in the propagator core and adding a comprehensive example demonstrating the new functionality.
- Added support for 3D ignition masks in
set_boundary_conditionsmethod - Updated docstring to reflect 2D or 3D ignition mask capability
- Added comprehensive example showcasing stochastic ignitions with multiple realizations
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/propagator/core/propagator.py | Modified ignition mask processing to handle both 2D and 3D arrays with proper realization mapping |
| src/propagator/core/models.py | Updated BoundaryConditions docstring to specify 2D or 3D mask support |
| example/example_stochastic_ignitions.py | New example demonstrating 3D ignition mask usage with stochastic scenarios |
| example/example.py | Enhanced existing example with better visualization and error handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
* build: add pre-commit, configured it, installed hooks and ran "run --all-files" * build: add ruff format and check to pre-commit * fix: mean values are 0 in case no info provided * feat: added option of disabling spotting from propagator settings * feat: added realizations number as constant * feat: added d1 and moisture as optional for fuel * feat:statistics in hectares * fix: moisture clipped in 0-1 range * fix:fixed computation of output to consider nan values properly * fix: removed reverence to cells area on statistics * added some comments and function's description * added some description on functions and option of cellsize in configuration * removed deprecated file * added option of isochrones thresholds from command line * return statistics oin squared meters * set example files * chore: add AGENTS.md * tests: add tests for propagator.core * chore: cleanup * added examples * chore: update .gitignore and add VSCode settings for tests * fixed lauch file for debugging * fix: removed model validation until it is fixed * fix: bug on bc initialization * chore: cleanup * feat: added option to switch to geotiff mode if dem and fuel are specified * chore: update vscode settings * Refactor and enhance geometries handling with Shapely (#5) * refactor: fix types * refactor: wip pydantic to shapely geometries * feat: add types-shapely dependency for improved type hinting * refactor: simpler actions parsing, use shapely geoms everywhere * chore: update launch configurations * fix: solves problem with heavy actions rasterizing to a np.zeros initialized matrix instead of nans. removed warnings for max in stats computation * fix: added option of point also with sqare brakets * feat: added default threshold levels for isochrones * fix: added weather conditions in boundary conditions as optional * fix: removed hardocoded boundaries in dataloader * refactor: better out of bounds handling out_of_bounds_mode can be set to "raise" or "ignore". It will throw PropagatorOutOfBoundsError when reaching the boundaries of the simulation if in "raise" mode. * chore: add types * updated agents.md * fix: update action parsing to handle legacy fields and merge to already defined actions * feat: added default options of ROS model and fuel moisture effect on constants * modified params for testing * fix: corrected wind direction from boundary conditions to the model convention * feat: added some print in the main * feat: separated cli from config , which comes from a separated file * fix: modify order of configuration parameters for readibility * fix: modified order of fields in configuration * fix: removed deprecated commented code * feat: added extra printing for the console * feat: added sh file for cache cleaning * fix: adjusted point print in the console * feat: added formatted printing for cli console * fix: removed 0.95 isochrones fro coherence with default statistics * fix: changed name from params to config for coherence * refactor: better tiles loading code - Structured tile metadata with TileReference and AxisCoverage dataclasses to replace unpacked tuples and centralize slice math, improving readability around window selection - Rebuilt load_tile to use pathlib, shared loaders, and richer error messages while still supporting .mat/.tif fallbacks and returning contiguous arrays - Simplified get_dem/get_veg and the tiling pipeline to reuse the generalized mosaic assembly helpers, eliminating the axis-specific branching and keeping outputs contiguous with explicit dtypes * test: fix tests after code updates * refactor: align internal wind angle representation to meteorological conventions * chore: cleanup and fixes fix typings for literals and add type:ignore when needed change example.py to a simpler streamlined example * refactor: update angle and wind direction descriptions to use clockwise radians --------- Co-authored-by: Perello-nico <[email protected]> * feat/time-in-seconds (#6) * feat: simulation time granularity switched from minutes to seconds - Converted configuration and boundary condition interfaces to seconds, updating defaults, docs, and metadata. - Propagation core now emits and schedules second-based times: p_time models multiply by 60, spotting returns integer seconds with a zero-wind guard, and decay logic interprets deltas per minute. - Adjusted status output and API docs to reflect second granularity . - Updated unit tests to exercise the new time base. * fix: fix typings and improve cli output * fix: invert loader priority * better cli and fix error in centroid calculation (#7) * fix: fix typings and improve cli output * fix: invert loader priority * fix: fix get_middle_point function behaviour with polygons * feat: improve cli output and add a flag for verbosity * feat: added option on cli for ou of bounds mode * feat: init_date is now UTC * feat: less verbose status messages * fix: improve example * fix: ensure time is an integer when logging * fix: improve time formatting in status messages * Better readme and docs (#9) * docs: improved docs content, improved mkdocs generated site * docs: update README and index * fix: enhance hero section layout and styling in documentation * build: update dependencies * Fix/remove-function-caching (#11) * Dev (#10) * fix: ensure time is an integer when logging * fix: improve time formatting in status messages * Better readme and docs (#9) * docs: improved docs content, improved mkdocs generated site * docs: update README and index * fix: enhance hero section layout and styling in documentation --------- Co-authored-by: Perello-nico <[email protected]> * fix: (tentative fix) set function caching to False to solve ReferenceError("underlying object has vanished") when using in a multiprocess environment * Stop tracking example/dem.tif with LFS * Store example/dem.tif as a regular Git file (no LFS) * fix: set jit cache=False to reduce issues with ReferenceError("underlying object has vanished") --------- Co-authored-by: Perello-nico <[email protected]> * fix: clarify simulation description in documentation * Feat/3d ignition mask (#13) * feat: 3d ignition masks in boundary conditions * improved examples * Update src/propagator/core/propagator.py Co-authored-by: Copilot <[email protected]> * Update src/propagator/core/propagator.py Co-authored-by: Copilot <[email protected]> * Update example/example_stochastic_ignitions.py Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> * refactor: simplify boundary conditions declaration for scalar values (#14) * refactor: simplify usage of scalar value boundary conditions fields, pass ignitions as tuples * simplify example * expand examples * cleanup gitignore * feat: add validation for ignition formats in BoundaryConditions --------- Co-authored-by: Perello-nico <[email protected]> Co-authored-by: Copilot <[email protected]>
Enables stocastich ignition scenario simulationg, adding "per-realization" ignition mask in
set_boundary_conditionby passing a 3D mask instead of a 2D one.Updated docstrings and add an example.