Skip to content

Parse ReEDS with r2x-cli

Use a parser-only pipeline to check the Pacific fixture tutorial run before adding target translation packages. Install the CLI plugin first. These commands follow r2x-cli 0.1.15; inspect your installed CLI’s help when using another version.

Use a working copy of the ReEDS run because parser upgrades can modify its files. After extracting the fixture as shown in the tutorial, save reeds-parser-pipeline.yaml in the tutorial workspace. For your own run, replace the path and years with selections present in its data:

pipelines:
parse:
- reeds-parser
config:
reeds-parser:
path: tutorial-inputs/test_Pacific
solve_year: 2032
weather_year: 2012
case_name: example

path supplies the CLI data-store root. It is not a ReEDSConfig field in Python; Python callers pass it to DataStore.from_plugin_config. Use one solve year and one weather year for this pipeline. The Python config accepts lists; downstream packages can impose narrower limits.

Terminal window
r2x list r2x-reeds
r2x run reeds-parser-pipeline.yaml --list
r2x run reeds-parser-pipeline.yaml parse --dry-run

Expect a parse pipeline containing reeds-parser. Dry run verifies pipeline resolution, not the contents of the input data. Create a separate output directory, then execute and save a portable artifact:

Terminal window
mkdir -p outputs
Terminal window
r2x run reeds-parser-pipeline.yaml parse --zip -o outputs/reeds-system.zip

Verify the artifact exists, then inspect it with the CLI:

Terminal window
ls -lh outputs/reeds-system.zip
r2x read outputs/reeds-system.zip --zip

The reader opens a Python session with the system bound to sys. For example:

>>> from r2x_reeds import ReEDSRegion
>>> assert len(list(sys.get_components(ReEDSRegion))) == 11

The assertion verifies the Pacific fixture region count. For your own run, compare it with the input regions. Exit the session when finished.

Insert a transform after reeds-parser and give it a configuration block. For example:

pipelines:
parse-and-split:
- reeds-parser
- break-gens
config:
reeds-parser:
path: tutorial-inputs/test_Pacific
solve_year: 2032
weather_year: 2012
break-gens:
drop_capacity_threshold: 5

break-gens uses packaged reference-unit defaults when reference_units is omitted. See transforms for the supported entry points and Python composition for explicit error handling.

For complete exports, follow the maintained ReEDS to PLEXOS or ReEDS to Sienna guide. Install the target packages those guides specify and verify their own configuration help; the parser package does not supply a target exporter.