Skip to content

Make geospatial_fabric_gpkg optional in config #174

Description

@taddyb

Context

After #173, the geodataset classes no longer need the GeoPackage for routing or training — flowpath attributes come from the adjacency zarr. The GeoPackage is only needed for:

  1. Plotting — visualization notebooks use geometry to draw river networks
  2. Legacy workflows — users who prefer the current gpkg-based setup

Currently, geospatial_fabric_gpkg is a required Path field in DataSources (validation/configs.py:47).

Proposal

Make geospatial_fabric_gpkg optional:

geospatial_fabric_gpkg: Path | None = Field(
    default=None,
    description="Path to the geospatial fabric geopackage (only required for plotting)"
)

Downstream changes

  • Any code that accesses cfg.data_sources.geospatial_fabric_gpkg must handle None
  • Plotting utilities should raise a clear error: "GeoPackage path not set. Provide geospatial_fabric_gpkg in your config to enable plotting."
  • Config templates for routing should omit or comment out the gpkg field

Files to modify

  • src/ddr/validation/configs.py — make field optional
  • src/ddr/validation/plots.py — guard against missing gpkg
  • config/templates/*.yaml — comment out gpkg for routing templates
  • Example configs — remove gpkg requirement

Acceptance criteria

  • ddr route works without geospatial_fabric_gpkg in config
  • ddr train works without geospatial_fabric_gpkg in config
  • Plotting code gives a clear error when gpkg is missing
  • Pydantic validation passes with and without the field
  • Existing tests pass

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions