Add regional historical land-use operator
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 23:25:15 +02:00
parent acac63a3dd
commit 3a8f6e6cef
13 changed files with 1165 additions and 11 deletions
@@ -90,11 +90,12 @@ def test_population_operator_resolves_the_persisted_scope_boundary(tmp_path: Pat
assert module.resolve_boundary_path(args, scope) == boundary
def test_regional_coordinator_builds_explicit_population_and_forest_commands(tmp_path: Path) -> None:
def test_regional_coordinator_builds_explicit_population_and_landuse_commands(tmp_path: Path) -> None:
module = load_script("provision_regional_timeseries.py")
scope = module.GEOGRAPHIC_SCOPES["kempen-transport-region"]
args = argparse.Namespace(
output_root=tmp_path / "time-series",
scope_output_root=tmp_path / "scopes",
fetch_only=False,
force=False,
skip_population=False,
@@ -102,15 +103,19 @@ def test_regional_coordinator_builds_explicit_population_and_forest_commands(tmp
base_url="http://backend:8000",
population_years="2021,2025",
landuse_years="2013,2025",
historical_years="1778,1873,1969",
historical_themes="buildings,water,roads",
request_timeout=300,
import_timeout=3600,
max_landuse_features=500000,
max_historical_features=500000,
skip_historical=False,
)
members_path = tmp_path / "municipalities.geojson"
commands = dict(module.build_operator_commands(args, scope, tmp_path / "boundary.geojson", members_path))
assert set(commands) == {"population", "forest"}
assert set(commands) == {"population", "forest", "historical_landuse"}
assert commands["population"][0] == sys.executable
assert "--scope" in commands["population"]
assert "kempen-transport-region" in commands["population"]
@@ -122,6 +127,10 @@ def test_regional_coordinator_builds_explicit_population_and_forest_commands(tmp
assert ",".join(scope.nis_codes) in commands["forest"]
assert "--force" not in commands["population"]
assert "--fetch-only" not in commands["forest"]
assert commands["historical_landuse"][0] == sys.executable
assert "provision_regional_historical_landuse.py" in commands["historical_landuse"][1]
assert "buildings,water,roads" in commands["historical_landuse"]
assert "--scope-output-root" in commands["historical_landuse"]
def test_regional_forest_provenance_does_not_claim_one_municipality() -> None: