Skip to content

Canopy inventory schema: add a crown-class source to the fuelcalc_table adjustment #521

Description

@amarcozzi

Part of #452.

Gap

fastfuels_core.canopy_fuel.available_canopy_fuel(crown_class_adjustment="fuelcalc_table", crown_class_column=...) reads each tree's crown position from a named inventory column, accepting FuelCalc's codes (D/C/I/S/O/E/SC/N, with O/E/SC folded onto C/D/I as CC_Adj does). The POST /grids/canopy/inventory schema has no field that names such a column: CanopyFuelcalcCrownClassAdjustment carries only missing_crown_class: "other_none", which applies one factor column to every tree.

So the schema cannot express the run that reproduces FuelCalc's tutorial output (per-tree D/C/I/S classes), and core's arm is unreachable from the API except through the blanket fallback.

Change

Add a crown_class_source to the fuelcalc_table arm, mirroring max_crown_radius_source:

{"method": "fuelcalc_table", "crown_class_source": {"type": "inventory_column", "column": "crown_class"}}
{"method": "fuelcalc_table", "crown_class_source": {"type": "constant", "value": "N"}}
  • inventory_column names a per-tree column of FuelCalc codes; griddle passes it through as crown_class_column.
  • constant is the existing fallback made explicit; griddle materialises a column of that code. "N" is what FuelCalc applies to a blank field.
  • griddle rejects inventory_column at request time when the inventory has no such column, rather than passing it to a core ValueError.

missing_crown_class goes away; its one value is constant: "N".

Not in scope

Whether v2 inventories gain a crown-class column (measured, imputed, modelled) is the data-gap decision in #452's comments; this issue only gives the schema a place to name one when it exists.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions