Skip to content

SustainableUrbanSystemsLab/NREL-PSM3-2-EPW

Repository files navigation

NREL-PSM3-2-EPW

Build-Test Streamlit App Version

A script and Streamlit app that writes out EPW files from NREL Physical Solar Model (PSM) v3.2.2 (and v4.0.0 API).

Features

  • EPW Conversion: Converts NREL solar data to EnergyPlus Weather format.
  • Streamlit App: User-friendly interface for downloading data.
  • Secure: API keys are managed via Streamlit secrets and verified with hash checks.
  • Modern Stack: Built with uv for dependency management and ruff for code quality.

Project Structure

  • app/: Contains the Streamlit application code.
    • streamlit_app.py: Main entry point.
    • .streamlit/secrets.toml: (Not committed) Stores your API key.
  • nrel_psm3_2_epw/: Core transformation logic.
  • tests/: Unit tests (100% coverage).

How to Run Locally

  1. Install dependencies with uv:

    uv sync --extra dev
  2. Configure API Key:

    • Create app/.streamlit/secrets.toml:
      APIKEY = "YOUR_NREL_API_KEY"
    • Note: The app verifies the default API key integrity.
  3. Run the App:

    uv run streamlit run app/streamlit_app.py

    (Windows users can use run_streamlit.bat)

  4. Run Tests:

    uv run pytest
  5. Lint & Format:

    uv run ruff check --fix .
    uv run ruff format .

Demo