Translate ReEDS to Sienna
See the ReEDS translation comparison for side-by-side component mappings, time-series treatment, and modeling limitations.
Parse the source model, translate its components, and export the target model.
Translation source · Configuration
Mapping Overview
Section titled “Mapping Overview”ReEDS technologies are translated into Sienna component families. Several ReEDS classes intentionally map to the same Sienna class, while demand and storage classes use dedicated target types.
flowchart LR R["ReEDS system"] --> N["Buses, areas + loads"] R --> G["Generation + storage"] N --> S["Sienna system"] G --> S T["Time series + emissions"] -. "attach derived data" .-> S class R source class N,G process class S target class T data classDef source fill:#d9effa,stroke:#0079c2,color:#003a69,stroke-width:2px classDef process fill:#f4f7f9,stroke:#7890a0,color:#293d4d classDef target fill:#003a69,stroke:#003a69,color:#ffffff,stroke-width:2px classDef data fill:#fff7e6,stroke:#c58625,color:#684716
Demand and Storage
Section titled “Demand and Storage”The demand-specific classes (ReEDSElectrolyzerDemand,
ReEDSSteamMethaneReformingDemand, ReEDSDataCenterDemand, and
ReEDSConsumingTechnology) become StandardLoad. Their time series and
annual demand information are attached by the translation helpers.
For field-by-field mappings, see ReEDS to Sienna property mappings.
Complete installation in a Python 3.11–3.13 virtual environment, then install the published translator and its parser/exporter dependencies:
python -m pip install r2x-reeds-to-siennapython -m pip checkUse compatible versions of the source and target packages. You do not need to modify this repository’s lockfile or add editable checkouts to run a translation. For a runnable exercise without external model data, start with the Python translation tutorial.
Run the translation
Section titled “Run the translation”Start a fresh Python console for this workflow. Replace the model paths and years
with your input data before entering the session below. A successful run writes
the target model and time-series files to the configured results directory.
run() executes the plugin lifecycle and raises an error if a hook fails.
>>> from pathlib import Path>>> from typing import cast
>>> from r2x_reeds import ReEDSConfig, ReEDSParser>>> from r2x_reeds_to_sienna.plugin_config import ReEDSToSiennaConfig>>> from r2x_reeds_to_sienna.translation import reeds_to_sienna>>> from r2x_sienna.exporter import SiennaExporter>>> from r2x_sienna.plugin_config import SiennaExporterConfig
>>> from r2x_core import DataStore, PluginContext>>> from r2x_core.logger import setup_logging
>>> setup_logging(verbosity=2)
>>> case_name = "reeds_run_folder_name">>> base_path = "/path/to/reeds/runs">>> run_path = Path(base_path) / case_name
>>> # ReEDS PARSER>>> solve_year = 2035>>> weather_year = 2012>>> scenario = "base">>> reeds_config = ReEDSConfig(... solve_year=solve_year,... weather_year=weather_year,... case_name=case_name,... scenario=scenario,... models=("r2x_reeds.models", "r2x_sienna.models"),... )
>>> store = DataStore.from_plugin_config(reeds_config, path=run_path)>>> context = PluginContext(config=reeds_config, store=store)
>>> parser = cast(ReEDSParser, ReEDSParser.from_context(context))>>> reeds_sys = parser.run()>>> reeds_sys = reeds_sys.system>>> sienna_sys = reeds_to_sienna(reeds_sys, ReEDSToSiennaConfig())>>> assert len(list(sienna_sys.iter_all_components())) > 0
>>> # Sienna Exporter>>> results_dir = Path(base_path) / f"{case_name}_results">>> results_dir.mkdir(exist_ok=True)
>>> exported_system = f"{case_name}.json">>> output_file = results_dir / exported_system>>> sienna_config = SiennaExporterConfig(... output_path=str(output_file),... system_base_power=100.0,... scenario=scenario,... )
>>> exporter_context = PluginContext(... config=sienna_config,... system=sienna_sys,... )>>> exporter = SiennaExporter.from_context(exporter_context)>>> export_result = exporter.run()>>> assert Path(output_file).is_file()