Skip to content

LANDFIRE fuel model creators: expose the disturbance option - #245

Merged
amarcozzi merged 1 commit into
mainfrom
244-landfire-disturbance
Oct 29, 2026
Merged

amarcozzi merged 1 commit into
mainfrom
244-landfire-disturbance

Conversation

@amarcozzi

Copy link
Copy Markdown
Contributor

Closes #244

FastFuels-API-v2#701 added a disturbance option to the LANDFIRE FBFM13, FBFM40 and FCCS grid requests. With it, the API updates the baseline release for recent disturbance where the newest release doesn't fully cover the domain, and records the plan on the grid as source.disturbance. The regenerated client already had the models; this exposes the option in the hand-written creators.

Changes

  • create_fuel_model_grid_from_landfire_fbfm13 / _fbfm40 / _fccs take a new disturbance=None argument. It's the last parameter, so no existing positional call shifts. A new _build_landfire_disturbance helper, following _build_boundary_scatter, accepts:

    • "landfire"
    • a mapping such as {"source": "landfire"}
    • a LandfireDisturbanceRequest

    Anything else raises ValueError. Version and season rules are left to the API's 422, as for the creators' other arguments.

  • Docstrings: tell users to omit version (or set it to the baseline release); FBFM40's also says not to combine disturbance with season. No release years are hardcoded, because the baselines come from API configuration.

  • Guide: creating-grids.md's "Disturbance grids" section gets a short step and an example, with the real source.disturbance output.

  • Tests:

    • Offline: the request body for each creator and each argument form, the default left out of the body, and invalid values rejected.
    • Live: test_live_fbfm40_disturbance creates its own small domain near Boulder, CO, where LANDFIRE 2025 only partly covers the area. It waits for completion, checks source.disturbance, and deletes the grid and the domain. It skips if the API says disturbance isn't needed there.

Verification

  • On prod at that location, the coverage endpoint showed 2025 as partial and the baseline as full for FBFM40, FBFM13 and FCCS.
  • An FBFM40 create with disturbance="landfire" and no version completed in 41 s with version 2024 and source.disturbance = {'ldist_version': '2025', 'fdist_version': '2024', 'source': 'landfire', 'mode': 'ldist_and_last_year_fdist'}. The API accepted FBFM13 and FCCS creates and recorded the same plan.
  • pytest tests/v2/test_grids.py -k "fbfm13 or fbfm40 or fccs or disturbance" against prod: 63 passed.
  • All prod resources created during testing were deleted and checked with a GET returning 404.

@amarcozzi
amarcozzi merged commit 56270df into main Oct 29, 2026
4 checks passed
@amarcozzi
amarcozzi deleted the 244-landfire-disturbance branch October 29, 2026 14:27
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.

LANDFIRE fuel model creators: expose the disturbance option (API-v2 #701)

1 participant