Skip to content

SDK: LeafLux solar irradiance grids (create_irradiance_grid_from_leaflux) - #205

Merged
amarcozzi merged 2 commits into
mainfrom
198-leaflux-irradiance-grid
Aug 26, 2026
Merged

SDK: LeafLux solar irradiance grids (create_irradiance_grid_from_leaflux)#205
amarcozzi merged 2 commits into
mainfrom
198-leaflux-irradiance-grid

Conversation

@amarcozzi

@amarcozzi amarcozzi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Adds create_irradiance_grid_from_leaflux(...) to fastfuels_sdk/v2/grids.py — the new solar/irradiance grid family. Derives a 3D LeafLux irradiance grid from a source 3D grid with a leaf_area_density band, taking date_time (UTC), optional source_terrain_grid, bands (LeafluxBand, default irradiance.surface.relative), and extinction_coefficient=0.5. Source grids accepted as Grid objects or ids (a Grid triggers completion + band validation and domain inference; an id requires domain=).

source_lad_grid_id rename — resolved in this PR

The deployed API has adopted API commit 86a5a67 (source_grid_idsource_lad_grid_id). This PR regenerates the client (only the leaflux request model changed) and points the wrapper at source_lad_grid_id. The live create test is no longer xfail — it passes end to end against the deployed API (verified, 45.8s).

Tests

  • 6 offline unit tests (request-building, defaults, Grid-or-id, domain inference, validations) — pass.
  • 1 live end-to-end test — passes.
  • black / flake8 clean (pre-commit enforced).

Closes #198

…grids

Wrap the generated create_leaflux_irradiance_grid endpoint as a new
solar/irradiance grid family. The function derives a 3D irradiance grid
from a source 3D grid carrying a leaf_area_density band, at a UTC
date_time, with an optional 2D terrain grid for surface irradiance,
LeafluxBand output selection (defaulting to irradiance.surface.relative),
and a Beer-Lambert extinction coefficient. Source grids are accepted as
Grid objects or ids.

Built against the current generated client, which serializes
source_grid_id. The deployed API renamed this to source_lad_grid_id
(86a5a67); the live create test is marked xfail until the client is
regenerated.
The deployed API has adopted the source_grid_id -> source_lad_grid_id
rename (API commit 86a5a67); regenerate the client (only the leaflux
request model changed) and switch the wrapper to source_lad_grid_id.

Drop the xfail on the leaflux live create test now that the field name
matches the deployed API; the test passes end to end.
@amarcozzi
amarcozzi merged commit bb1de15 into main Aug 26, 2026
2 of 3 checks passed
@amarcozzi
amarcozzi deleted the 198-leaflux-irradiance-grid branch August 26, 2026 17:03
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.

SDK: Leaflux solar irradiance grids (new grid family)

1 participant