Skip to content

feat: real ERCOT public-API ingestion (RT/DAM SPP + system load) - #24

Merged
oldhero5 merged 14 commits into
mainfrom
feat/ercot-power-cleanup
Jun 28, 2026
Merged

feat: real ERCOT public-API ingestion (RT/DAM SPP + system load)#24
oldhero5 merged 14 commits into
mainfrom
feat/ercot-power-cleanup

Conversation

@oldhero5

@oldhero5 oldhero5 commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Replaces the placeholder ERCOT scaffold with a real, verified, complete ERCOT public-API
ingestion section. Every endpoint/auth/field fact was verified against the live ERCOT API.

What changed

  • Auth rewrite to the real Azure AD B2C ROPC flow: correct token URL, fixed public
    client_id, scope, response_type=id_token, and send the id_token as Bearer
    (the scaffold wrongly read access_token). Subscription key via Ocp-Apim-Subscription-Key.
  • Real response handling: parse the data (array-of-arrays) + fields envelope and
    paginate via page/size over _meta.totalPages (the scaffold assumed array-of-objects
    and had no pagination → silent truncation). Lowercase EMIL paths.
  • Correct timestamps: Central Prevailing Time (hour-ending, DST-aware) → tz-aware UTC.
    The scaffold parsed Central as UTC.
  • Three real connectors: RT SPP (np6-905-cd) → power.lmp, DAM SPP (np4-190-cd) →
    new power.dalmp, system load (np6-345-cd) → power.load. RT and DAM are split into
    separate libraries (same point/hour, different prices) to avoid a data collision.
  • Ingest the 13 canonical tradeable settlement points (5 hubs + 8 load zones) via the
    server-side settlementPointType filter, not all ~1,123 resource nodes.
  • Removed the dead ERCOT_FUELMIX schema/route — ERCOT's public API has no fuel-mix
    report; fuel mix is already served by EIA-930 (EIA930.GEN_FUEL.ERCO).
  • Assets/checks/schedules for all three series, schedules shipped RUNNING.
  • Config: read the subscription key from ERCOT_API_KEY_PRIMARY (with the legacy
    ERCOT_SUBSCRIPTION_KEY as a fallback alias) + optional secondary.
  • Fixed 3 time-brittle connector tests (EIA-930 + ERCOT) whose fixtures had aged past
    the freshness gate; fixtures are now relative to date.today().
  • Docs + .env.example updated to reflect an active ERCOT section.

Verification

  • Full suite green (209 passed); ruff clean on src/energex + tests; Dagster definitions
    validate via CLI.
  • Live end-to-end run against the real ERCOT API: RT SPP 1,248 rows (13 points × 96
    intervals), DAM 312 rows, load 24 hourly rows — all pass the quality gate; timezone
    conversion verified (CDT day → correct UTC range).

Follow-on fixes (pre-existing issues found during verification)

  • Serving: the S2 read API now publishes on host :8000 (it was on :8001 while a stale, orphaned legacy container squatted :8000). /series, /curve, /symbols, /libraries, /healthz are live; ERCOT data is queryable end-to-end (/series?library=power.lmp&symbol=hb_houston).
  • Examples lint: fixed 21 pre-existing ruff errors under src/examples (auto-fix + a scoped per-file-ignore for demo print()/dict()); ruff check src tests is now clean.
  • Local .env: import energex now loads the repo-root .env for local runs (guarded so pytest's no-creds invariant is preserved); the deployment still injects env via docker-compose.

oldhero5 added 14 commits June 28, 2026 11:43
…schedules

Replace the single placeholder ercot_spp asset with three real assets (ercot_rt_spp
-> power.lmp, ercot_dam_spp -> power.dalmp, ercot_load -> power.load), each with a
read-back quality-gate check and an enabled (RUNNING) schedule. Remove the temporary
ErcotSppConnector alias.
@oldhero5
oldhero5 merged commit f8e77a4 into main Jun 28, 2026
9 checks passed
@oldhero5
oldhero5 deleted the feat/ercot-power-cleanup branch June 28, 2026 16:40
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