Skip to content

Crown base height: regenerate client, add crown base height creator (#246) - #247

Merged
amarcozzi merged 3 commits into
mainfrom
246-crown-base-height
Oct 30, 2026
Merged

amarcozzi merged 3 commits into
mainfrom
246-crown-base-height

Conversation

@amarcozzi

@amarcozzi amarcozzi commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #246.

Brings the v2 client up to the crown base height contract deployed in silvxlabs/FastFuels-API-v2#749. crown_ratio stays FIA's compacted crown ratio; the new crown_base_height column (m) is what voxelize and canopy grids read.

Breaking: InventoryAttribute drops CROWN_RATIO and gains CROWN_BASE_HEIGHT, so tree_attribute("crown_ratio", ...) and modify_trees("crown_ratio", ...) now raise ValueError (the API already returns 422 for them). Also breaking: the GDAM request models are renamed after silvxlabs/FastFuels-API-v2#752 — CreateGdamInventoryRequest → CreateGdamAllometryRequest and CreateGdamInventoryRequestImputeColumnsItem → CreateGdamAllometryRequestImputeColumnsItem (the new crown base height request is CreateCrownBaseHeightAllometryRequest). Release as v0.24.0.

Changes

  • Regenerated client_library/ from the prod spec (26 files: the new crown base height route, its request and 7 model classes, InventoryAttribute, InventoryColumnMapping.crown_base_height, GDAM overwrite / crown_base_height_model, description updates).
  • New create_tree_inventory_from_crown_base_height(domain, source_inventory, model=None, overwrite=False, ...). model takes a name ("toney_reeves_2009"), a {"name": ...} mapping, or a generated model object; unknown values raise ValueError before any request.
  • create_tree_inventory_from_gdam gains crown_base_height_model and overwrite; docstring now lists all four impute columns.
  • Modification and upload-role docstrings, voxelize/canopy Raises, and the inventories, modify/treat and migration guides use crown_base_height. The CHM stem-isolation crown_ratio (a window-size parameter) is unchanged.
  • PIM and PIM-CHM fusion creators are unchanged: their request bodies have no crown base model option (only the stored source records it).

Testing

  • New offline tests for the model helper, both request bodies, and the modification attribute swap pass.
  • Two live tests were added (the new route with overwrite=True; fusion expects a crown_base_height column) and have not been run yet.

…#246)

create_tree_inventory_from_crown_base_height wraps the new
allometry/crown_base_height route. create_tree_inventory_from_gdam gains
crown_base_height_model and overwrite, and imputes crown_base_height by
default. Both accept a crown base height model by name, as a mapping, or as
a model object.

Modification attributes swap crown_ratio for crown_base_height, matching
the API's InventoryAttribute; a crown_ratio modification now raises
ValueError client-side.
@amarcozzi
amarcozzi merged commit d578cdd into main Oct 30, 2026
4 checks passed
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.

Regenerate the v2 client for crown_base_height (breaking)

1 participant