| --- |
| title: OCx25 Dashboard |
| license: cc-by-4.0 |
| emoji: ⚗️ |
| colorFrom: blue |
| colorTo: green |
| sdk: gradio |
| python_version: "3.12" |
| app_file: app.py |
| pinned: false |
| --- |
| |
| # OCx25 Dashboard |
|
|
| An interactive web dashboard for exploring and analyzing data from OCx25 experiments, featuring HER (Hydrogen Evolution Reaction) and CO2RR (CO2 Reduction Reaction) performance data, as well as XRD (X-ray Diffraction) data. |
|
|
| This project is part of the OCx25 research: https://ai.meta.com/blog/open-catalyst-simulations-experiments/. |
|
|
| **Paper:** [Open Catalyst Experiments 2024 (OCx24): Bridging Experiments and Computational Models](https://arxiv.org/abs/2411.11783) |
|
|
| ## Features |
|
|
| - **Interactive Data Filtering**: Filter data by source, batch, reaction type, element count, and voltage/current density ranges |
| - **Data Aggregation**: Average data across multiple replicates with statistical analysis |
| - **Interactive Plots**: Dedicated plotting interfaces for HER and CO2RR performance visualization |
| - **XRD Analysis Dashboard**: Comprehensive X-ray diffraction data analysis with phase identification and fitting |
| - **Data Export**: Export filtered or averaged data to CSV format |
| - **Composition Analysis**: Support for both XRF and target composition data |
| - **Voltage Conversion**: Customizable voltage conversion parameters for electrochemical measurements |
|
|
| ## Data Structure |
|
|
| ### Electrochemical Data |
| The dashboard works with electrochemical experimental data including: |
| - Elemental compositions (XRF and target) |
| - Voltage and current density measurements |
| - Faradaic efficiency measurements |
| - Batch and source tracking |
| - Multiple measurement replicates |
|
|
| ### XRD Data Structure |
| The XRD Analysis Dashboard loads its bundled data on demand from local Flask endpoints. The data structure includes: |
|
|
| #### Data Storage |
| - **Location**: `Data/XRD/`, tracked with Git LFS |
| - **Format**: Gzip-compressed JSON files containing XRD measurement data |
| - **Access**: Same-origin Flask endpoints under `/xrd/data/` |
| - **Organization**: Data organized by datasets and sample identifiers |
|
|
| ## Usage |
|
|
| ### Local Development |
| ```bash |
| python OCx25_dashboard.py |
| ``` |
|
|
| ### Production Deployment |
| The application automatically detects production environments and adjusts its behavior accordingly. |
|
|
| ### Hugging Face Spaces |
|
|
| Create a new **Gradio** Space and push this repository to it. Hugging Face will |
| install `requirements.txt` automatically, then run `app.py`, which starts the |
| existing Flask dashboard with Gunicorn on the required port (`7860`). |
|
|
| ```bash |
| git remote add space https://huggingface.co/spaces/<username>/<space-name> |
| git push space main |
| ``` |
|
|
| Hugging Face Space storage is ephemeral by default. Uploaded/filtered runtime |
| state can reset when the Space restarts; the versioned files under `Data/` |
| remain available. |
|
|
| ### Accessing Dashboards |
| - **Main Dashboard**: `/` - Overview and data filtering interface |
| - **HER Analysis**: `/her/` - Hydrogen Evolution Reaction plotting and analysis |
| - **CO2RR Analysis**: `/co2/` - CO2 Reduction Reaction plotting and analysis |
| - **XRD Analysis**: `/xrd/` - X-ray Diffraction data analysis and phase identification |
|
|
| ### XRD Dashboard Access |
| The XRD Analysis Dashboard requires: |
| 1. **Git LFS data**: Run `git lfs pull` after cloning the repository |
| 2. **Local XRD files**: Metadata and dataset JSON files under `Data/XRD/` |
|
|
| **Note**: If XRD data fails to load, it may indicate: |
| - Sample doesn't have XRD data available |
| - Git LFS files were not downloaded |
| - The selected local dataset file is unavailable |
|
|
| ## Dependencies |
|
|
| See `requirements.txt` for a complete list of Python dependencies including: |
| - Flask for web framework |
| - Pandas for data manipulation |
| - Plotly for interactive visualizations |
| - Matplotlib for static plots |
| - NumPy and SciPy for numerical operations |
|
|
| ## File Structure |
|
|
| - `app.py` - Hugging Face Spaces entry point |
| - `OCx25_dashboard.py` - Main Flask application file |
| - `her_plot_blueprint.py` - HER-specific plotting blueprint |
| - `co2_plot_blueprint.py` - CO2RR-specific plotting blueprint |
| - `xrd_plot_blueprint.py` - XRD Analysis Dashboard blueprint |
| - `templates/dashboard.html` - Main dashboard HTML template |
| - `Data/` - Local data files directory |
| - [`voltage_conversion_example.ipynb`](./voltage_conversion_example.ipynb) - Full-cell voltage conversion example |
| - `requirements.txt` - Python dependencies |
|
|