Skip to content

Scripts for downloading reverse pourbaix data#1475

Draft
zccalka wants to merge 1 commit into
materialsproject:mainfrom
zccalka:pourbaix_downloader
Draft

Scripts for downloading reverse pourbaix data#1475
zccalka wants to merge 1 commit into
materialsproject:mainfrom
zccalka:pourbaix_downloader

Conversation

@zccalka

@zccalka zccalka commented Jun 9, 2026

Copy link
Copy Markdown

Adds a pre-computed reverse Pourbaix stability dataset and the scripts used to generate it. The dataset powers the reverse Pourbaix diagram tool on the MP website.

Contributor Checklist

  • I have broken down my PR scope into the following TODO tasks
    • schema.py — defines the (pH, V) grid, parquet schema. Essentially the settings for the downloaded data.
    • pourbaix_cache.py — utilities for batch Pourbaix data generation: a SQLite-backed entry cache to avoid redundant API calls, a PourbaixDiagram subclass that skips redundant preprocessing when computing stability for many materials in the same chemical system, and a vectorized decomposition energy scan over the (pH, V) grid.
    • downloader.py — orchestrator script that queries the MP API, applies the above utilities, and writes the final parquet file consumed by the web app. TODO: Maybe this can be optimized further? Currently the download takes around 8 hours running from my hpc. The script also formats the parquet and json files. TODO: another parquet instead of the heatmap json file.
  • I have run the tests locally and they passed.
    • Not applicable perhaps?
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR
    • Not applicable perhaps?

@zccalka

zccalka commented Jun 9, 2026

Copy link
Copy Markdown
Author

@tsmathis for review

@zccalka zccalka force-pushed the pourbaix_downloader branch from d1c5ecf to 4036550 Compare June 9, 2026 22:25
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