Skip to content

NatLabRockies/r2x-reeds

Repository files navigation

r2x-reeds

ReEDS parser and transforms plugin for the r2x-core plugin framework.

CI Actions Quality Python PyPI License codecov Documentation

Warning

This project is currently optimized for internal R2X workflows. You are welcome to use it, but APIs and behavior may continue to evolve as r2x-core evolves.

r2x-reeds integrates NREL ReEDS model data with r2x-core and infrasys. It provides a parser plugin for building infrasys.System objects from ReEDS data, plus a set of reusable post-parse transforms for common system-modification workflows.

Quickstart · Installation · What It Provides · Usage with r2x-core · Development · License

Quickstart

Install:

pip install r2x-reeds

Parse a ReEDS run directory into an infrasys.System:

from pathlib import Path

from r2x_core import DataStore, PluginContext
from r2x_reeds import ReEDSConfig, ReEDSParser

run_path = Path("path/to/reeds_run")

config = ReEDSConfig(
    solve_year=2030,
    weather_year=2012,
    case_name="test_Pacific",
)
ctx = PluginContext(
    config=config,
    store=DataStore.from_plugin_config(config, path=run_path),
)

system = ReEDSParser.from_context(ctx).run().system
print(system.name)

Installation

From PyPI

Python requirement: >=3.11, <3.14.

pip install r2x-reeds

Using uv:

uv add r2x-reeds

From Source

git clone https://github.com/NREL/r2x-reeds.git
cd r2x-reeds
uv sync --all-groups

What It Provides

  • ReEDSParser: reads ReEDS outputs and inputs (CSV/HDF5-backed mappings) into infrasys.System components and time series.
  • ReEDSUpgrader and run_reeds_upgrades(...): input version-detection and upgrade pipeline run during parser lifecycle.
  • Plugin entry point for r2x-core under the r2x_plugin group:
    • reeds-parser = r2x_reeds:ReEDSParser
  • Transform entry points under r2x.transforms:
    • add-pcm-defaults
    • add-emission-cap
    • add-electrolyzer-load
    • add-purchaser-load
    • add-ccs-credit
    • break-gens
    • add-imports
    • add-optimal-siting

Usage with r2x-core

r2x-reeds follows the r2x-core plugin lifecycle.

  • Build parser instances with PluginContext.
  • Run lifecycle hooks with .run().
  • Configure parsing through ReEDSConfig.
  • Apply optional r2x.transforms after parsing for scenario/system modifiers.

Development

Install dev dependencies:

uv sync --all-groups

Run the same checks used in CI:

uv run prek run --all-files --hook-stage pre-push

Targeted commands:

uv run pytest -q -m "not slow" --maxfail=1 --disable-warnings
uv run ty check ./src/r2x_reeds/

License

BSD 3-Clause. See LICENSE.txt.

About

Reeds parser and models

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages