Support pinned historic OSM snapshots for reproducibility

未关闭
#10 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python, yaml

调研方向

Start by reading workflow/scripts/_schema.py and the existing retrieve.target_date handling, then compare the proposed osm_data config with the referenced PyPSA-Earth PR #2005 and the historical test config in pypsa-earth-osm. First resolve the open questions about the historical-data backend, date granularity and output metadata. Done means historical snapshots are validated and stored separately, the historical path runs in CI, and the docs explain reproducibility and its limits.

由索引模型根据 Issue 内容生成。

描述

Is your feature request related to a problem? Please describe.

Grid models built from "latest" OSM data cannot be reproduced. OSM changes continuously, so the same config run a month apart yields a different network. Results, validation and published studies cannot be re-run or compared against a fixed input. Pinning the OSM snapshot date is a prerequisite for reproducible runs.

Describe the solution you'd like

A config-selectable OSM data source with an explicit snapshot date, and snapshots stored per date so runs with different dates never overwrite each other.

Proposed config (same shape as the one already implemented in PyPSA-Earth):

osm_data:
  source: historical      # latest | historical | custom
  target_date: "2020-01-01"   # YYYY-MM-DD, required for historical
  • latest: current OSM data (default, unchanged behaviour)
  • historical: data as of target_date
  • custom: user-provided .pbf and optional pre-filtered power files

Raw data is stored per snapshot, e.g. data/osm/<subdir>/ where <subdir> is YYYYMM, latest or custom.

Acceptance criteria:

  • Same config + same target_date gives identical raw OSM input across runs
  • Different dates are stored in separate directories and do not overwrite each other
  • target_date is validated (format, not in the future, not before the earliest supported snapshot)
  • A test config exercising the historical path (e.g. target_date: 2020-01-01) runs in CI
  • Docs describe the options and the reproducibility guarantee and its limits

Prior work (what is already done and can be reused)

  • pypsa-earth-osm
    • #5 historical OSM data integration (from earth-osm#63)
    • #16 separate OSM data into date-specific directories
    • #27 test config for historical data (test/config.historical.yaml)
  • pypsa-earth
    • #2005 ports the feature with the osm_data config section above; requires earth-osm>=3.0.2 (open)

Describe alternatives you've considered

  • Pinning a downloaded .pbf by hand (custom source): works, but the snapshot date is not recorded in the config and is easy to lose.
  • Committing/archiving the raw data per study: heavy, and does not scale across users.

Open questions

  • Which backend should serve historic data here (earth-osm historical feature vs Geofabrik history files vs Overpass date: queries)? Each has a different earliest date and coverage.
  • Should the resolved snapshot date be written into the output metadata so results are traceable?
  • Granularity of the snapshot: month (YYYYMM, as in PyPSA-Earth) or exact date?

Additional context

Related: retrieve.target_date in grid-builder (workflow/scripts/_schema.py) currently exists but is only honoured for retrieve.source: geofabrik, so the Overpass path is not reproducible today.

主要语言
Python
星标
7
派生
2
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PyPSA/grid-builder 的其他 Issue

查看 PyPSA/grid-builder 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。