Sienna model plugin
Project description
[!WARNING] This project is currently optimized for internal R2X workflows. You are welcome to use it, but APIs and behavior may continue to evolve as
r2x-coreevolves.
r2x-sienna integrates Sienna-style PSY data with r2x-core and infrasys.
It provides parser and exporter plugins, plus version-upgrade utilities for input
JSON, so Sienna data can be loaded into System objects and written back out in
PSY-compatible form.
Quickstart · Installation · What It Provides · Usage with r2x-core · Development · License
Quickstart
Install:
pip install r2x-sienna
Parse a Sienna JSON system into an infrasys.System, then export it back to
PSY JSON:
from pathlib import Path
from r2x_core import DataStore, PluginContext
from r2x_sienna import (
SiennaConfig,
SiennaExporter,
SiennaExporterConfig,
SiennaParser,
)
data_path = Path("tests/data/case5_pjm_rt/c_sys5_pjm_rt.json")
out_path = Path("output/system.json")
# Parse
parse_cfg = SiennaConfig(
model_year=2029,
system_name="PJM-5",
json_path=str(data_path),
)
parse_ctx = PluginContext(config=parse_cfg, store=DataStore(path=data_path.parent))
parsed_system = SiennaParser.from_context(parse_ctx).run().system
# Export
export_cfg = SiennaExporterConfig(output_path=str(out_path))
export_ctx = PluginContext(config=export_cfg, system=parsed_system, store=DataStore(path=out_path.parent))
SiennaExporter.from_context(export_ctx).run()
Installation
From PyPI
Python requirement: >=3.11, <3.14.
pip install r2x-sienna
Using uv:
uv add r2x-sienna
From Source
git clone https://github.com/NREL-Sienna/r2x-sienna.git
cd r2x-sienna
uv sync --all-groups
What It Provides
SiennaParser: reads Sienna PSY JSON and related time series metadata intoinfrasys.System.SiennaExporter: writesinfrasys.Systemback to Sienna-compatible PSY JSON, including supplemental attributes and optional HDF5 time series export.SiennaUpgraderandrun_sienna_upgrades(...): version-detection and upgrade pipeline for legacy JSON data before parsing.- Plugin entry points for
r2x-coreunder ther2x_plugingroup:sienna-parser = r2x_sienna:SiennaParsersienna-exporter = r2x_sienna:SiennaExporter
Usage with r2x-core
r2x-sienna follows the r2x-core plugin lifecycle.
- Build parser/exporter instances with
PluginContext. - Run plugin hooks through
.run(). - Access parser/exporter configs through
SiennaConfigandSiennaExporterConfig.
The parser on_upgrade() hook automatically runs Sienna data upgrades when
json_path is provided, then proceeds with deserialization into a System.
Development
Install dev dependencies:
uv sync --all-groups
Run the same checks used in CI:
uv run prek run --all-files --hook-stage pre-push
Targeted commands:
uv run pytest -q -m "not slow" --maxfail=1 --disable-warnings
uv run ty check ./src/r2x_sienna/
License
BSD 3-Clause. See LICENSE.txt.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file r2x_sienna-0.2.1.tar.gz.
File metadata
- Download URL: r2x_sienna-0.2.1.tar.gz
- Upload date:
- Size: 53.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7555881adc4f8964f87aac2f4799aaa8db56df6f294d3a9fa0e43d90dffe0bc6
|
|
| MD5 |
109823941c8fd6292fd5fda004a053a0
|
|
| BLAKE2b-256 |
5151641a6a8f40c126c5fd989cb94f47bc0a53c0c5f72c69a6f96f757914efca
|
Provenance
The following attestation bundles were made for r2x_sienna-0.2.1.tar.gz:
Publisher:
release.yaml on NREL-Sienna/r2x-sienna
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
r2x_sienna-0.2.1.tar.gz -
Subject digest:
7555881adc4f8964f87aac2f4799aaa8db56df6f294d3a9fa0e43d90dffe0bc6 - Sigstore transparency entry: 1244615285
- Sigstore integration time:
-
Permalink:
NREL-Sienna/r2x-sienna@6f343c02231516c884bb90afc365b192c1b73b5f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NREL-Sienna
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@6f343c02231516c884bb90afc365b192c1b73b5f -
Trigger Event:
push
-
Statement type:
File details
Details for the file r2x_sienna-0.2.1-py3-none-any.whl.
File metadata
- Download URL: r2x_sienna-0.2.1-py3-none-any.whl
- Upload date:
- Size: 62.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
231ccd52908eac2b3a084659215c6cb61689a168ba7257e45e94e6038d60c26d
|
|
| MD5 |
6e8bbef98798b9180c49073995380ef5
|
|
| BLAKE2b-256 |
def10b734a4fb36480c8d56a144c859c6f003ac0c2712ff29f5f1abeeae7a828
|
Provenance
The following attestation bundles were made for r2x_sienna-0.2.1-py3-none-any.whl:
Publisher:
release.yaml on NREL-Sienna/r2x-sienna
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
r2x_sienna-0.2.1-py3-none-any.whl -
Subject digest:
231ccd52908eac2b3a084659215c6cb61689a168ba7257e45e94e6038d60c26d - Sigstore transparency entry: 1244615321
- Sigstore integration time:
-
Permalink:
NREL-Sienna/r2x-sienna@6f343c02231516c884bb90afc365b192c1b73b5f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NREL-Sienna
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@6f343c02231516c884bb90afc365b192c1b73b5f -
Trigger Event:
push
-
Statement type: