Run your first CLI pipeline
Build a two-step pipeline around a small public Sienna model. You will read the model, write a Sienna JSON export, and inspect a portable system archive. No ReEDS run or licensed PLEXOS installation is needed for this tutorial.
Before you start
Section titled “Before you start”Complete Prerequisites and
Installation first, including the
r2x-sienna installation and plugin discovery checks. The commands below use
a macOS or Linux shell and curl.
This tutorial was executed with r2x-cli 0.1.15, its Python 3.12 runtime, r2x-core 0.9.0, and r2x-sienna 0.5.0.
Create a workspace
Section titled “Create a workspace”Create a directory to keep the inputs, configuration and results together.
Choose another name if r2x-quickstart/ already exists:
mkdir r2x-quickstartMove into it. Run the rest of this tutorial from this directory so relative paths resolve consistently:
cd r2x-quickstartCreate the starter configuration:
r2x initCheck that pipeline.yaml exists before continuing:
ls pipeline.yamlDownload a small model
Section titled “Download a small model”Create separate directories for downloaded inputs and generated results:
mkdir -p inputs outputsDownload the model description from a pinned upstream revision.
The line breaks below belong to one curl command:
curl -fsSL \ https://raw.githubusercontent.com/NatLabRockies/r2x-sienna/4a5b365e8637ebb56e5cf389b32eec801265072f/tests/data/2area-5bus-system/test_system.json \ -o inputs/test_system.jsonDownload its companion time-series data from the same revision:
curl -fsSL \ https://raw.githubusercontent.com/NatLabRockies/r2x-sienna/4a5b365e8637ebb56e5cf389b32eec801265072f/tests/data/2area-5bus-system/test_system_time_series_storage.h5 \ -o inputs/test_system_time_series_storage.h5Confirm that both files are present and nonempty:
ls -lh inputsBoth files must stay in the same directory. The JSON identifies its companion HDF5 file by name. The fixture is a PowerSystems 5.0 system with two areas and ten buses (five per area).
Define the pipeline
Section titled “Define the pipeline”Replace the template in pipeline.yaml with:
variables: input_dir: inputspipelines: inspect-sienna: - sienna-parser - sienna-exporterconfig: sienna-parser: json_path: ${input_dir}/test_system.json model_year: 2030 system_name: two-area-demo sienna-exporter: output_path: outputs/roundtrip.jsonoutput_folder: outputspipelines gives the execution order.
config provides the settings for each installed plugin.
The CLI passes the parsed system to the exporter.
Preview and execute
Section titled “Preview and execute”From the workspace directory, list the available pipeline:
r2x run pipeline.yaml --listExpect inspect-sienna with the parser and exporter as its two steps.
Preview the flow without reading the model or writing an export:
r2x run pipeline.yaml inspect-sienna --dry-runThe CLI prints sienna-parser → sienna-exporter and confirms that no execution occurred.
A dry run checks pipeline discovery and configuration; it does not prove that the input model can be parsed.
Execute it and save a portable archive:
r2x run pipeline.yaml inspect-sienna --zip -o outputs/system.zipA successful run reports both steps and creates:
| File | Purpose |
|---|---|
outputs/roundtrip.json | Exported native Sienna model. |
outputs/roundtrip_time_series_storage.h5 | Its companion time-series data. |
outputs/system.zip | Portable parsed system and time series for CLI inspection. |
The first run may take longer while Python imports and model data are prepared.
Inspect the result
Section titled “Inspect the result”Save this file as inspect_system.py in the workspace:
from r2x_sienna.models import ACBus
sys.info()print("Buses:", len(list(sys.get_components(ACBus))))Run it against the portable archive:
r2x read outputs/system.zip --zip --exec inspect_system.pyr2x read exposes the loaded system as sys to the inspection script.
Expect a system summary and Buses: 10.
For interactive exploration, omit --exec to open the CLI’s Python session.
If a step fails
Section titled “If a step fails”Check that both downloaded inputs remain in inputs/ and run commands from
r2x-quickstart/. For plugin discovery, missing storage, invalid artifacts or
existing output files, follow troubleshooting.
Compare r2x python show with the ABI required by your CLI binary if runtime
startup fails.
For deeper component, field and time-series inspection, follow inspect a transformed system.
Next, translate a ReEDS run to Sienna or inspect the Python API.