Add Fosberg dead fuel moisture grid SDK support - #207
Conversation
Wrap the create_fosberg_fuel_moisture_grid endpoint as create_dead_fuel_moisture_grid_from_fosberg, a new fuel_moisture grid family derived from a topography grid (slope + aspect) and a Leaflux irradiance grid. Source grids are accepted as Grid objects or bare ids; when a Grid is passed it is checked for completion and required bands, and the domain is resolved from it. Validates dry_bulb_temp (>= 10), relative_humidity (0-100), and time (HHMM 0800-1959), and coerces month/elevation to their enums. Adds offline unit tests for request-building and range validation plus a live end-to-end test.
…-moisture-grid # Conflicts: # fastfuels_sdk/v2/grids.py # tests/v2/test_grids.py
|
On hold — do not merge yet. The Fosberg SDK wrapper and its offline tests are complete and passing, and this branch has been merged up to date with
Holding this PR until #547 lands, after which |
…-moisture-grid # Conflicts: # tests/v2/test_grids.py
|
Unblocked — ready to merge. FastFuels-API-v2 #548 (reject source grids that don't share a horizontal lattice) is merged and deployed to Merged |
Summary
Wraps the generated
create_fosberg_fuel_moisture_gridendpoint as a new grid family (fuel_moisture) with no prior SDK surface:ff.grids.create_dead_fuel_moisture_grid_from_fosberg(...), returning a pendingGridwhose singlefuel_moisture.dead.1hrband is derived from a topography grid (slope+aspect) and a Leaflux irradiance grid (irradiance.surface.relative).Gridobjects or bare id strings. When aGridis passed, it is checked for completion and required bands, and the domain id is resolved from it; when both sources are bare ids the call raises a clearValueError(the domain can't be resolved).dry_bulb_temp >= 10,relative_humidity0–100,timein HHMM 0800–1959 (minutes 00–59) — mirroring the_duet_integerstyle, and coercesmonth/elevationto their enums.grids.__all__(module-qualifiedff.grids.create_*, matching the other creators).Testing
TestCreateDeadFuelMoistureGridFromFosbergmirroring the DUET test class: request-building (via monkeypatched endpoint), grid-object/id resolution, domain-resolution error, completion/band guards, and parametrized range validation. 16 offline unit tests pass; full offline unit selection (Fosberg + helpers + alignment + signatures) is 35 passing.blackandflake8are clean (enforced by pre-commit).test_create_live) that voxelizes a tree inventory (leaf_area_density), builds a Leaflux irradiance grid, then creates and waits on the Fosberg grid.Live-test status
The live API and credentials work (the voxelize step runs live). However the generated Leaflux client is currently out of sync with the live server: it sends
source_grid_idwhile the server now requiressource_lad_grid_id, so the irradiance prerequisite can't be built yet. This is a Leaflux (#195) client-regeneration concern, not part of the Fosberg endpoint. The live test thereforepytest.skips with a clear reason when the irradiance grid can't be created, so it exercises the Fosberg call end-to-end once the Leaflux client is realigned, without spuriously failing CI in the meantime.Closes #197