Skip to content

Add a forefire-validate landscape checker - #190

Open
HugoFara wants to merge 1 commit into
devfrom
feat/landscape-validate
Open

Add a forefire-validate landscape checker#190
HugoFara wants to merge 1 commit into
devfrom
feat/landscape-validate

Conversation

@HugoFara

Copy link
Copy Markdown
Collaborator

Closes#169.

A forefire-validate landscape.nc fuels.csv command that checks a landscape
against 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:

  • Decision logic is pure and I/O-free (build_report); a thin netCDF4
    adapter (read_landscape) 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; documented in TESTING.md and the Python
    README.

Note: the entry point is new pyproject.toml metadata, so it appears after a
reinstall/rebuild — worth a CHANGELOG line at the next release.


Generated by Claude Opus 4.8, and reviewed manually before posting.

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
Sign up for freeto 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

@HugoFara