From 0f64185fbdc14a30b7c3aa82ee61b5963036b7f0 Mon Sep 17 00:00:00 2001 From: Anthony Marcozzi Date: Mon, 3 Nov 2025 17:42:06 -0700 Subject: [PATCH] Add `canopyHeightMapSource` to tree inventory configuration and update tests --- fastfuels_sdk/convenience.py | 10 ++++++++-- tests/test_convenience_config.py | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/fastfuels_sdk/convenience.py b/fastfuels_sdk/convenience.py index 7a94e7c..07ce0d2 100644 --- a/fastfuels_sdk/convenience.py +++ b/fastfuels_sdk/convenience.py @@ -102,7 +102,10 @@ def _deep_merge(base: Dict[str, Any], override: Dict[str, Any]) -> None: "featureGridAttributes": ["road", "water"], } -DEFAULT_TREE_INVENTORY_CONFIG = {"featureMasks": ["road", "water"]} +DEFAULT_TREE_INVENTORY_CONFIG = { + "featureMasks": ["road", "water"], + "canopyHeightMapSource": "Meta2024", +} def _configure_topography_builder(domain_id: str, config: Dict[str, Any]): @@ -497,7 +500,10 @@ def export_roi( tree_inventory = Inventories.from_domain_id( domain.id ).create_tree_inventory_from_treemap( - feature_masks=["road", "water"], canopy_height_map_source="Meta2024" + feature_masks=merged_tree_inventory_config.get("featureMasks", []), + canopy_height_map_source=merged_tree_inventory_config.get( + "canopyHeightMapSource" + ), ) # Create surface grid using configuration diff --git a/tests/test_convenience_config.py b/tests/test_convenience_config.py index 4aab362..516e6ee 100644 --- a/tests/test_convenience_config.py +++ b/tests/test_convenience_config.py @@ -150,7 +150,7 @@ def test_current_hardcoded_topography_config( # Verify tree inventory was created with current masks mock_inventories_instance.create_tree_inventory_from_treemap.assert_called_once_with( - feature_masks=["road", "water"] + feature_masks=["road", "water"], canopy_height_map_source="Meta2024" ) def test_default_configuration_constants(self): @@ -181,6 +181,7 @@ def test_default_configuration_constants(self): # Test tree inventory config assert DEFAULT_TREE_INVENTORY_CONFIG["featureMasks"] == ["road", "water"] + assert DEFAULT_TREE_INVENTORY_CONFIG["canopyHeightMapSource"] == "Meta2024" class TestConfigurationMerger: