Skip to content

SustainableUrbanSystemsLab/NLR-PSM3-2-EPW

Repository files navigation

NLR-PSM3-2-EPW

Build-Test Streamlit App Version

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

Features

  • EPW Conversion: Converts NLR 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.
  • nlr_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_NLR_API_KEY"
    • Request or manage your API key at https://developer.nlr.gov/signup
    • API documentation is available at https://developer.nlr.gov
    • 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