Skip to content

Python API

Run each configuration example in a fresh Python session. These examples run without model data. For complete parsing, translation, and export, use the linked workflow guides.

These public functions operate on parsed r2x_core.System objects. They translate components and attach time series; the target exporter writes the native model files. For command-line execution, follow the CLI tutorial.

View function source →

reeds_to_plexos(system: System, config: ReedsToPlexosConfig) -> System

Translate ReEDS components to PLEXOS and attach reserve, generator, region-load, and purchaser time series.

ParameterContract
systemParsed ReEDS system containing the components and time series expected by the workflow.
configReedsToPlexosConfig. See the configuration fields below.

Returns a new PLEXOS system with the translated components and attached time series. Input time-series storage is reused by the target system. The default hydro budget resolution is daily. Missing required input data or invalid mapping/configuration values can raise errors during rule application or post-processing.

>>> from r2x_reeds_to_plexos.plugin_config import ReedsToPlexosConfig
>>> config = ReedsToPlexosConfig()
>>> assert config.hydro_budget_ts == 'daily'

source: r2x_reeds_to_plexos.translation · property mappings

View configuration source →

Keyword-only typed configuration for reeds_to_plexos. The table lists the fields declared by this translation package, including their actual defaults. Inherited configuration behavior is documented in r2x-core.

FieldTypeDefault
modelstuple[str, ...]['r2x_reeds.models', 'r2x_plexos.models', 'r2x_reeds_to_plexos.getters_utils']
commit_technologieslist[str] | None[]
hydro_budget_tsLiteral['hourly', 'daily', 'weekly', 'monthly']'daily'
use_fuel_objectsboolFalse
  • models: Modules used to resolve ReEDS sources and PLEXOS targets.
  • commit_technologies: Technologies to commit.
  • hydro_budget_ts: Output resolution for hydro budget time series.
  • use_fuel_objects: Create PLEXOS Fuel objects from ReEDS fuel data and link generators through the Fuels collection instead of writing fuel price on each generator. See Fuel objects.

source: r2x_reeds_to_plexos.plugin_config

View function source →

reeds_to_sienna(system: System, config: ReEDSToSiennaConfig) -> System

Translate ReEDS components to Sienna, normalize generator active-power profiles, attach pumped-hydro inflow, and add generator emissions.

ParameterContract
systemParsed ReEDS system containing the components and time series expected by the workflow.
configReEDSToSiennaConfig. See the configuration fields below.

Returns a new Sienna system with the translated components and attached time series. The target system uses a 100 MVA system base. Input time-series storage is reused by the target system. Missing required input data or invalid mapping/configuration values can raise errors during rule application or post-processing.

>>> from r2x_reeds_to_sienna.plugin_config import ReEDSToSiennaConfig
>>> config = ReEDSToSiennaConfig()
>>> assert config.technology_mapping == {}

source: r2x_reeds_to_sienna.translation · property mappings

View configuration source →

Keyword-only typed configuration for reeds_to_sienna. The table lists the fields declared by this translation package, including their actual defaults. Inherited configuration behavior is documented in r2x-core.

FieldTypeDefault
modelstuple[str, ...]['r2x_reeds.models', 'r2x_sienna.models']
technology_mappingdict[str, dict[str, str]] | None{}
  • models: Modules used to resolve ReEDS sources and Sienna targets.
  • technology_mapping: Technology category to prime mover/fuel type mappings

source: r2x_reeds_to_sienna.plugin_config

View function source →

plexos_to_sienna(system: System, config: PlexosToSiennaConfig) -> System

Translate PLEXOS components to Sienna and synchronize node, purchaser, generator, and battery time series.

ParameterContract
systemParsed PLEXOS system containing the components and time series expected by the workflow.
configPlexosToSiennaConfig. See the configuration fields below.

Returns a new Sienna system with the translated components and attached time series. The source time-series storage is converted to permanent Arrow storage before translation. Missing required input data or invalid mapping/configuration values can raise errors during rule application or post-processing.

>>> from r2x_plexos_to_sienna.plugin_config import PlexosToSiennaConfig
>>> config = PlexosToSiennaConfig()
>>> assert config.technology_mapping == {}

source: r2x_plexos_to_sienna.translation · property mappings

View configuration source →

Keyword-only typed configuration for plexos_to_sienna. The table lists the fields declared by this translation package, including their actual defaults. Inherited configuration behavior is documented in r2x-core.

FieldTypeDefault
modelstuple[str, ...]['r2x_plexos.models', 'r2x_sienna.models']
technology_mappingdict[str, dict[str, str]] | None{}
  • models: Modules used to resolve PLEXOS sources and Sienna targets.
  • technology_mapping: Technology category to prime mover/fuel type mappings

source: r2x_plexos_to_sienna.plugin_config

View function source →

sienna_to_plexos(system: System, config: SiennaToPlexosConfig) -> System

Translate Sienna components to PLEXOS, resolve conflicting source components, consolidate zones, attach time series, and establish the target memberships.

ParameterContract
systemParsed Sienna system containing the components and time series expected by the workflow.
configSiennaToPlexosConfig. See the configuration fields below.

Returns a new PLEXOS system with the translated components and attached time series. The translation also applies the package’s exporter patches and resolves source conflicts. Use a separate loaded system if you need an untouched source. Missing required input data or invalid mapping/configuration values can raise errors during rule application or post-processing.

>>> from r2x_sienna_to_plexos.plugin_config import SiennaToPlexosConfig
>>> config = SiennaToPlexosConfig()
>>> assert config.hydro_budget_ts == 'weekly'

source: r2x_sienna_to_plexos.translation · property mappings

View configuration source →

Keyword-only typed configuration for sienna_to_plexos. The table lists the fields declared by this translation package, including their actual defaults. Inherited configuration behavior is documented in r2x-core.

FieldTypeDefault
modelstuple[str, ...]['r2x_sienna.models', 'r2x_plexos.models']
prime_mover_mappingdict[str, list[str]] | None{}
hydro_budget_tsLiteral['hourly', 'daily', 'weekly', 'monthly']'weekly'
  • models: Modules used to resolve Sienna sources and PLEXOS targets.
  • prime_mover_mapping: Prime mover/fuel to technology category mappings
  • hydro_budget_ts: Output resolution for hydro budget time series.

source: r2x_sienna_to_plexos.plugin_config