Skip to content

Add current year LFPS support to griddle for LANDFIRE fuel models - #542

Merged
lindsaywiard merged 6 commits into
mainfrom
537-add-current-year-lfps-support-to-griddle-for-landfire-fuel-models
Aug 26, 2026
Merged

Add current year LFPS support to griddle for LANDFIRE fuel models#542
lindsaywiard merged 6 commits into
mainfrom
537-add-current-year-lfps-support-to-griddle-for-landfire-fuel-models

Conversation

@lindsaywiard

Copy link
Copy Markdown
Collaborator

Summary

Griddle can now fetch the current year's FCCS, FBFM13, and FBFM40 release via LANDFIRE Product Service (LFPS) instead of a staged COG, for any version listed in a product's lfps_available config (currently 2025).

Changes

  • lib\landfire\config.py: Added lfps_available: ["2025"] to fbfm13 and fccs in LANDFIRE_VERSIONS (fbfm40 already had it).
  • griddle\handlers\landfire.py: fetch_fbfm13 and fetch_fccs now route to LFPS when the requested version is in lfps_available, mirroring the branch fetch_fbfm40 already had for seasonal requests. fetch_fbfm40's routing is generalized so an lfps_available version routes through LFPS even without a season.
  • griddle\dispatch.py: progress is now threaded through to fetch_fbfm13/fetch_fccs.

Tests

  • Unit tests (mocked) for the new LFPS branch on all three fetch functions
  • Integration tests that submit a real LFPS job for each product's configured lfps_available version
  • A test that fails (not skips) if LANDFIRE moves the seasonal base vintage past our configured version — so a stale lfps_available config surfaces instead of going unnoticed.

@lindsaywiard lindsaywiard linked an issue Aug 25, 2026 that may be closed by this pull request
@lindsaywiard
lindsaywiard force-pushed the 537-add-current-year-lfps-support-to-griddle-for-landfire-fuel-models branch from e8f0f83 to dd89863 Compare August 25, 2026 22:57

@amarcozzi amarcozzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a bug here:

All three PR #542 handlers define:

progress: Callable[...] | None = None

For version="2025", they pass that value directly to fetch_lfps, which immediately executes:

progress("Submitting LANDFIRE Product Service job...", 10)

If omitted, this becomes None(...) and raises before job submission.

Focused test against PR head 2e6bb55:

CONFIRMED: TypeError: 'NoneType' object is not callable
submit_job called: False

Existing tests miss it because they always provide a MagicMock callback. The preferred fix is to substitute a no-op callback and add
omitted-callback tests for FBFM13, FBFM40, and FCCS.

@lindsaywiard

Copy link
Copy Markdown
Collaborator Author

I think that bug is all fixed up now :)

@amarcozzi

Copy link
Copy Markdown
Contributor

Can we just pass it and utilize a callable as normal instead of the new object/None?

@lindsaywiard

Copy link
Copy Markdown
Collaborator Author

Yep, makes sense! Like this?

@amarcozzi

Copy link
Copy Markdown
Contributor

It's not a big deal, but it just really feels like an anti-pattern to me. I don't understand why we need a default_progress and don't just give it the same callable as what every other function in griddle.

so kind of like:

Delete this:

def _default_progress(message: str, pct: int | None = None) -> None:
    """No-op progress callback used when a caller doesn't provide one."""

def fetch_fbfm13(
    roi: gpd.GeoDataFrame,
    version: str = LANDFIRE_VERSIONS["fbfm13"]["default"],
    ...
    progress: Callable[[str, int | None], None] = _default_progress,
) -> xr.Dataset:

And just do:

def fetch_fbfm13(
    roi: gpd.GeoDataFrame,
    version: str = LANDFIRE_VERSIONS["fbfm13"]["default"],
    ...
    progress: Callable[[str, int | None], None],   # required, like fetch_lfps
) -> xr.Dataset:

@lindsaywiard

Copy link
Copy Markdown
Collaborator Author

Yeah, that is cleaner. I was just stuck in how it was already set up. How's this?

@amarcozzi

Copy link
Copy Markdown
Contributor

Looks great thank you! Sorry to be a stickler about something minor. Approved and ready to merge.

@lindsaywiard

Copy link
Copy Markdown
Collaborator Author

No worries! I'm happy to indulge

@lindsaywiard
lindsaywiard merged commit d03a95e into main Aug 26, 2026
1 check passed
@lindsaywiard
lindsaywiard deleted the 537-add-current-year-lfps-support-to-griddle-for-landfire-fuel-models branch August 26, 2026 20:51
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.

Add current-year LFPS support to griddle for LANDFIRE Fuel Models

2 participants