Silent data mutation, missing provenance in the compile pipeline and DEA URL (404)

オープン
#281 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
python

調査の方向性

scripts/retrieve_data_from_dea.py から始め、python scripts/retrieve_data_from_dea.py を実行して 404 を再現します。次に compile_cost_assumptions.py と、名前が挙げられているパイプライン関数を調べます。snakemake -call --forceall を使って、より広範な問題を確認します。これらの調査結果を焦点を絞った変更に落とし込み、検証、来歴、手動入力の動作をテストまたは監査可能な実行レポートでカバーできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

Checklist

  • I am using the current master branch or the latest release v0.15.0

Describe the Bug

Findings from a first-pass review of technology-data v0.15.0, as discussed with @euronion. Listing them together for triage; happy to split into separate focused issues.

1. No validation of output parameters
docs/parameter.csv lists 11 core parameters; the output contains 59. Nothing validates output parameters against a known list, so new or misspelled parameters pass through silently.

2. Hardcoded metadata in compile_cost_assumptions.py
The script holds 6+ hardcoded dicts (dea_sheet_names, uncrtnty_lookup, cost_year_2020, cost_year_2019, source_dict, per-tech usecols). Proposal: move them to a config file, compare against the data at runtime, and report new/missing entries at the end of the run. Same pattern applies to parameters, technologies and units.

3. Imputation is not recorded
.fillna(0), .ffill(), .interpolate() and .mean() are applied silently — the output does not distinguish sourced values from imputed ones. Proposal: tag imputed values in further description or in a dedicated data_quality column.

4. retrieve_data_from_dea.py is broken
It points at the old DEA URL (404). DEA has restructured into 8 category pages under technology-catalogues. The script was never updated (the new URL appears in the v0.14.0 release notes, but data was only downloaded manually) and is not wired into Snakemake.

5. manual_input.csv entries are silently overwritten
add_manual_input uses combine_first so manual values beat DEA data, but later .loc assignments in add_co2_intensity(), add_solar_from_other() and the hardcoded biomass fuel values overwrite manual_input entries unconditionally. These legacy functions predate the manual_input mechanism. Proposal: end the pipeline after data collection + manual input.

6. No per-run data provenance report
Items 1–5 are the same underlying problem: the pipeline mutates data silently. A per-run report covering source coverage, imputations, overrides, unknown parameters and data freshness would make all of it auditable. Combined with dataset versioning, this would let a user reconstruct where any value came from.

Minimal example

Item 4 reproduces on its own:

python scripts/retrieve_data_from_dea.py

The remaining items are observable in the output of a full pipeline run:

snakemake -call --forceall

Error Message

retrieve_data_from_dea.py — the configured DEA URL returns HTTP 404:

None
主要言語
Python
スター
130
フォーク
59
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PyPSA/technology-data のほかの issue

PyPSA/technology-data の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。