Skip to content

Feat/trinidad feeder pipeline - #58

Merged
AadilLatif merged 6 commits into
mainfrom
feat/trinidad-feeder-pipeline
Sep 1, 2026
Merged

AadilLatif merged 6 commits into
mainfrom
feat/trinidad-feeder-pipeline

Conversation

@AadilLatif

Copy link
Copy Markdown
Collaborator

Change Summary

Related issue number

Checklist

  • The pull request title is a good summary of the changes.
  • Tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including "please review" to assign reviewers

Parcel data acquisition:
- Add attribute-mapping layer (parcel_sources.py) decoupling source columns
  from ParcelModel field population; OSM mapper is the default so existing
  behavior is unchanged.
- Add parcels_from_gis() to fetch building/parcel features from a public
  ArcGIS FeatureServer REST endpoint (no Esri login required).
- ParcelsFromGeodataframe now accepts an optional mapper and name_column.

Feeder / substation boundaries:
- split_substations_into_feeders() tiles a service-area polygon into one cell
  per substation, then splits each by relative area (smallest->3, largest->8).
- substation_boundaries.py tiles a polygon into non-overlapping cells, one per
  substation found inside it.

Overpass failover:
- Consolidate Overpass mirror failover into shift.utils.overpass and remove the
  duplicated logic from openstreet_roads and the MCP parcels/roads tools.
Add a parallel feeder DistributionSystem build pipeline (feeder_models.py)
that splits a service area into substation/feeder cells, builds each feeder's
graph with the substation as source, and right-sizes equipment against a
gdmloader CatalogSystem (conductors converted to matrix branch equipment via
GeometryBranchEquipment.to_matrix_representation). Configurable via a pydantic
FeederModelConfig loaded from TOML, including GIS (ArcGIS FeatureServer),
GeoDataFrame, OSM, and PBF parcel sources.

Fixes found while building real models for Trinidad, CO:
- substation.py: Overpass mirror failover + per-polygon cache, form-encoded
  POST (406), valid GeoJSON features, OSM voltage tag parser
- parcel_sources.py: ArcGIS point geometry normalization
- get_cluster.py: GeoLocation point parcels in centroid_and_area_m2
- catalog_utils.py / edge_equipment_mapper.py: phase (line-to-ground)
  transformer voltage matching, split-phase center-tapped synthesis, source
  voltage line-to-line
- graph: connect disconnected components to the source (radial), empty road
  fallbacks, road-tree secondary, substation merge for near-coincident OSM ways
- openstreet_roads.py: pyosmium bbox extraction fallback and robust
  graph_from_xml (retain_all) when the osmium CLI is unavailable

Add scripts/plot_feeders.py to render all feeders as one interactive HTML map
with primary/secondary/load coloring.
@AadilLatif
AadilLatif merged commit 995004c into main Sep 1, 2026
10 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 1, 2026
…er-pipeline

Feat/trinidad feeder pipeline
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.

1 participant