Python API
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.
Translation functions
Section titled “Translation functions”reeds_to_plexos
Section titled “reeds_to_plexos”reeds_to_plexos(system: System, config: ReedsToPlexosConfig) -> SystemTranslate ReEDS components to PLEXOS and attach reserve, generator, region-load, and purchaser time series.
| Parameter | Contract |
|---|---|
system | Parsed ReEDS system containing the components and time series expected by the workflow. |
config | ReedsToPlexosConfig. 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 ReedsToPlexosConfigfrom r2x_reeds_to_plexos.translation import reeds_to_plexos
# source_system is the parsed system from the workflow guide.target_system = reeds_to_plexos(source_system, ReedsToPlexosConfig())source: r2x_reeds_to_plexos.translation · property mappings
ReedsToPlexosConfig
Section titled “ReedsToPlexosConfig”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.
| Field | Type | Default |
|---|---|---|
models | tuple[str, ...] | ['r2x_reeds.models', 'r2x_plexos.models', 'r2x_reeds_to_plexos.getters_utils'] |
commit_technologies | list[str] | None | [] |
hydro_budget_ts | Literal['hourly', 'daily', 'weekly', 'monthly'] | 'daily' |
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.
source: r2x_reeds_to_plexos.plugin_config
reeds_to_sienna
Section titled “reeds_to_sienna”reeds_to_sienna(system: System, config: ReEDSToSiennaConfig) -> SystemTranslate ReEDS components to Sienna, normalize generator active-power profiles, attach pumped-hydro inflow, and add generator emissions.
| Parameter | Contract |
|---|---|
system | Parsed ReEDS system containing the components and time series expected by the workflow. |
config | ReEDSToSiennaConfig. 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 ReEDSToSiennaConfigfrom r2x_reeds_to_sienna.translation import reeds_to_sienna
# source_system is the parsed system from the workflow guide.target_system = reeds_to_sienna(source_system, ReEDSToSiennaConfig())source: r2x_reeds_to_sienna.translation · property mappings
ReEDSToSiennaConfig
Section titled “ReEDSToSiennaConfig”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.
| Field | Type | Default |
|---|---|---|
models | tuple[str, ...] | ['r2x_reeds.models', 'r2x_sienna.models'] |
technology_mapping | dict[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
plexos_to_sienna
Section titled “plexos_to_sienna”plexos_to_sienna(system: System, config: PlexosToSiennaConfig) -> SystemTranslate PLEXOS components to Sienna and synchronize node, purchaser, generator, and battery time series.
| Parameter | Contract |
|---|---|
system | Parsed PLEXOS system containing the components and time series expected by the workflow. |
config | PlexosToSiennaConfig. 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 PlexosToSiennaConfigfrom r2x_plexos_to_sienna.translation import plexos_to_sienna
# source_system is the parsed system from the workflow guide.target_system = plexos_to_sienna(source_system, PlexosToSiennaConfig())source: r2x_plexos_to_sienna.translation · property mappings
PlexosToSiennaConfig
Section titled “PlexosToSiennaConfig”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.
| Field | Type | Default |
|---|---|---|
models | tuple[str, ...] | ['r2x_plexos.models', 'r2x_sienna.models'] |
technology_mapping | dict[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
sienna_to_plexos
Section titled “sienna_to_plexos”sienna_to_plexos(system: System, config: SiennaToPlexosConfig) -> SystemTranslate Sienna components to PLEXOS, resolve conflicting source components, consolidate zones, attach time series, and establish the target memberships.
| Parameter | Contract |
|---|---|
system | Parsed Sienna system containing the components and time series expected by the workflow. |
config | SiennaToPlexosConfig. 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 SiennaToPlexosConfigfrom r2x_sienna_to_plexos.translation import sienna_to_plexos
# source_system is the parsed system from the workflow guide.target_system = sienna_to_plexos(source_system, SiennaToPlexosConfig())source: r2x_sienna_to_plexos.translation · property mappings
SiennaToPlexosConfig
Section titled “SiennaToPlexosConfig”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.
| Field | Type | Default |
|---|---|---|
models | tuple[str, ...] | ['r2x_sienna.models', 'r2x_plexos.models'] |
prime_mover_mapping | dict[str, list[str]] | None | {} |
hydro_budget_ts | Literal['hourly', 'daily', 'weekly', 'monthly'] | 'weekly' |
models: Modules used to resolve Sienna sources and PLEXOS targets.prime_mover_mapping: Prime mover/fuel to technology category mappingshydro_budget_ts: Output resolution for hydro budget time series.