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
Install:
pip install r2x-reedsParse 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)Python requirement: >=3.11, <3.14.
pip install r2x-reedsUsing uv:
uv add r2x-reedsgit clone https://github.com/NREL/r2x-reeds.git
cd r2x-reeds
uv sync --all-groupsReEDSParser: reads ReEDS outputs and inputs (CSV/HDF5-backed mappings) intoinfrasys.Systemcomponents and time series.ReEDSUpgraderandrun_reeds_upgrades(...): input version-detection and upgrade pipeline run during parser lifecycle.- Plugin entry point for
r2x-coreunder ther2x_plugingroup:reeds-parser = r2x_reeds:ReEDSParser
- Transform entry points under
r2x.transforms:add-pcm-defaultsadd-emission-capadd-electrolyzer-loadadd-purchaser-loadadd-ccs-creditbreak-gensadd-importsadd-optimal-siting
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.transformsafter parsing for scenario/system modifiers.
Install dev dependencies:
uv sync --all-groupsRun the same checks used in CI:
uv run prek run --all-files --hook-stage pre-pushTargeted commands:
uv run pytest -q -m "not slow" --maxfail=1 --disable-warnings
uv run ty check ./src/r2x_reeds/BSD 3-Clause. See LICENSE.txt.