Uh oh!
There was an error while loading. Please reload this page.
Add a forefire-validate landscape checker - #190
Open
HugoFara wants to merge 1 commit into
Open
Conversation
Check a landscape .nc against a fuel table before a run: report any fuel index present in the raster but missing from the table, flag a fuel/elevation shape mismatch, and warn when elevation or wind is absent. This is the cheapest fix for the most confusing failure mode, where a mismatch makes the simulation fail or produce wrong results with no message. The decision logic is kept pure and I/O-free (build_report), with a thin netCDF4 adapter (read_landscape) that asks for netCDF4 only when a file must be read, so the wheel gains no hard dependency. Exposed as the forefire-validate console entry point. test_validate.py loads the checker from source and covers the pure logic without the compiled extension; the real-.nc case is skipped when netCDF4 is absent. Wired into run.bash and documented in TESTING.md and the Python README. Closes#169
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 freeto 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.
Closes#169.
A
forefire-validate landscape.nc fuels.csvcommand that checks a landscapeagainst its fuel table before a run — the cheapest fix for the most confusing
failure mode, where an unmapped fuel index makes the simulation fail or produce
wrong results with no message.
It reports any fuel index present in the raster but missing from the table,
flags a fuel/elevation shape mismatch, and warns when elevation or wind is
absent (exit non-zero on any error).
Design:
build_report); a thinnetCDF4adapter (
read_landscape) asks fornetCDF4only when a file must be read,so the wheel gains no hard dependency.
forefire-validateconsole entry point.test_validate.pyloads the checker from source and covers the pure logicwithout the compiled extension; the real-
.nccase is skipped whennetCDF4is absent. Wired into
run.bash; documented inTESTING.mdand the PythonREADME.
Note: the entry point is new
pyproject.tomlmetadata, so it appears after areinstall/rebuild — worth a CHANGELOG line at the next release.
Generated by Claude Opus 4.8, and reviewed manually before posting.