Skip to content

feat: include tilt and orientation in Data Platform location metadata… - #228

Open
PavanRaghavendraKulkarni wants to merge 4 commits into
mainfrom
strip_data_model
Open

PavanRaghavendraKulkarni wants to merge 4 commits into
mainfrom
strip_data_model

Conversation

@PavanRaghavendraKulkarni

@PavanRaghavendraKulkarni PavanRaghavendraKulkarni commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

forecast-inference is moving to read all site data (including tilt/orientation) directly from the Data Platform instead of the site database. DP has no native field for these — they're a property of the specific energy source, not the underlying geometry — so this PR writes them into each location's metadata on create/update (confirmed to land on sources_history, not geometries: verified via source-code trace of the DP server and a live behavioral test — renaming a location leaves its metadata untouched).

create_location()/update_location() in dataplatform_client.py now accept optional tilt/orientation, and main.py's site create/edit routes pass them through. update_location() also gains an opt-in raise_on_error flag (default False, live API behavior unchanged) so batch tooling can detect real failures instead of the existing swallow-and-log default silently reporting success.

⚠️ Requires a one-time backfill before this is useful for existing sites — this only writes tilt/orientation going forward. Run scripts/backfill_dp_tilt_orientation.py (new in this PR) against the target environment to populate DP metadata for sites that predate this change:

Tests:

  1. This one is tested against the dev dataplatform
  2. Ran script
DB_URL=... DATA_PLATFORM_HOST=... DATA_PLATFORM_PORT=... \
    python scripts/backfill_dp_tilt_orientation.py --apply

@PavanRaghavendraKulkarni
PavanRaghavendraKulkarni marked this pull request as ready for review August 28, 2026 13:15
Comment thread pv_site_api/dataplatform_client.py
@PavanRaghavendraKulkarni

Copy link
Copy Markdown
Contributor Author

Script ran only on the Development not on the Production

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.

2 participants