`ferc` demand profile cannot be built: retrieve_pudl.py reads an undefined output and the census parquet is not in the PUDL bucket

Aperta
#890 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Read workflow/scripts/retrieve_pudl.py and the retrieve_pudl rule in workflow/rules/retrieve.smk to trace the output mismatch. Then inspect _read_census_data in workflow/scripts/build_demand.py and the demand_raw_data inputs to choose and verify a census source; check issue #394 for the existing state shapes. Done when the ferc demand profile can be parsed or dry-run without the undefined output or missing parquet.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Two independent defects on develop each stop electricity.demand.profile: ferc from building.

1. retrieve_pudl.py reads an output the rule does not define

workflow/scripts/retrieve_pudl.py does

save_pudl = snakemake.output.pudl

but rule retrieve_pudl (workflow/rules/retrieve.smk) only declares pudl_ferc714 and census. Snakemake raises on the missing name:

AttributeError: 'OutputFiles' object has no attribute 'pudl'

save_pudl is never used afterwards, so the line can simply be removed.

2. _read_census_data reads a parquet file that does not exist

workflow/scripts/build_demand.py (_read_census_data, ~line 330) queries

{pudl_path}/censusdp1tract.state_2010census_dp1.parquet

That key returns HTTP 404 at both v2025.5.0 and v2026.10.0. Listing the bucket with prefix <version>/census returns only censusdp1tract.sqlite.zip.

Meanwhile retrieve_pudl still downloads censusdp1tract.sqlite from Zenodo and demand_raw_data still lists it as an input for the ferc profile, but nothing reads it.

Suggested fix
  • Drop the snakemake.output.pudl line.
  • Pick one source for the state shapes: either read the state layer from the already-downloaded censusdp1tract.sqlite, or use the state shapes the workflow already builds (see #394), and remove whichever census artifact ends up unused.
  • Add a fast test that at least parses/dry-runs the ferc profile so this path is covered.
How this was found

While reviewing #785. The AttributeError was confirmed against snakemake.io.OutputFiles; the 404s were confirmed with HEAD requests and a bucket listing on 2026-11-11. The ferc profile was not run end to end.

Lingua principale
Python
Stelle
154
Fork
58
Merge medio
3g 9h
PR unite (30g)
51

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PyPSA/pypsa-usa

Tutte le issue di PyPSA/pypsa-usa

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.