r2x 2.2.0__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- r2x-2.3.0/PKG-INFO +117 -0
- r2x-2.3.0/README.md +66 -0
- {r2x-2.2.0 → r2x-2.3.0}/pyproject.toml +13 -13
- r2x-2.2.0/PKG-INFO +0 -371
- r2x-2.2.0/README.md +0 -320
- {r2x-2.2.0 → r2x-2.3.0}/LICENSE.txt +0 -0
- {r2x-2.2.0 → r2x-2.3.0}/src/r2x/__init__.py +0 -0
r2x-2.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: r2x
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: Translation Plugins for mainstream models.
|
|
5
|
+
Keywords: power-systems,energy-modeling,model-translation,reeds,plexos,sienna,plugin-architecture
|
|
6
|
+
Author: pesap, kodiobika, Vivienne Liu, Micah Webb, Kinshuk Panda, mcllerena, jarry7
|
|
7
|
+
Author-email: pesap <pesap@users.noreply.github.com>, kodiobika <kodiobika@users.noreply.github.com>, Vivienne Liu <vivienne.liu@nrel.gov>, Micah Webb <micahpw@user.noreply.github.com>, Kinshuk Panda <7632244+k1nshuk@users.noreply.github.com>, mcllerena <mcllerena@users.noreply.github.com>, jarry7 <27745389+jarry7@users.noreply.github.com>
|
|
8
|
+
License: BSD 3-Clause License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2024, Alliance for Sustainable Energy LLC, All rights reserved.
|
|
11
|
+
|
|
12
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
13
|
+
|
|
14
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
15
|
+
|
|
16
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
17
|
+
|
|
18
|
+
* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
21
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
22
|
+
Classifier: Intended Audience :: Developers
|
|
23
|
+
Classifier: Intended Audience :: Science/Research
|
|
24
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
25
|
+
Classifier: Natural Language :: English
|
|
26
|
+
Classifier: Operating System :: OS Independent
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
29
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
30
|
+
Classifier: Topic :: File Formats :: JSON
|
|
31
|
+
Classifier: Topic :: Scientific/Engineering
|
|
32
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
33
|
+
Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
|
|
34
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
35
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
36
|
+
Classifier: Typing :: Typed
|
|
37
|
+
Requires-Dist: r2x-sienna-to-plexos
|
|
38
|
+
Requires-Dist: r2x-plexos-to-sienna
|
|
39
|
+
Requires-Dist: r2x-reeds-to-plexos
|
|
40
|
+
Requires-Dist: r2x-reeds-to-sienna
|
|
41
|
+
Requires-Dist: r2x-core>=1.0.0,<2.0.0
|
|
42
|
+
Maintainer: pesap, Kinshuk Panda, mcllerena, jarry7, kodiobika
|
|
43
|
+
Maintainer-email: pesap <pesap@users.noreply.github.com>, Kinshuk Panda <7632244+k1nshuk@users.noreply.github.com>, mcllerena <mcllerena@users.noreply.github.com>, jarry7 <27745389+jarry7@users.noreply.github.com>, kodiobika <kodiobika@users.noreply.github.com>
|
|
44
|
+
Requires-Python: >=3.11, <3.14
|
|
45
|
+
Project-URL: Homepage, https://github.com/NatlabRockies/r2x
|
|
46
|
+
Project-URL: Documentation, https://natlabrockies.github.io/R2X/
|
|
47
|
+
Project-URL: Repository, https://github.com/NatlabRockies/r2x
|
|
48
|
+
Project-URL: Issues, https://github.com/NatlabRockies/r2x/issues
|
|
49
|
+
Project-URL: Changelog, https://natlabrockies.github.io/R2X/reference/changelog/
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
<img src="./docs/src/assets/r2x-logo-full-square.svg" alt="R2X framework logo" align="left" width="220px" height="220px" hspace="10"/>
|
|
53
|
+
<img align="left" alt="" width="0" height="220px" hspace="10"/>
|
|
54
|
+
|
|
55
|
+
#### R2X
|
|
56
|
+
<p><small>Translation plugins for ReEDS, PLEXOS, and Sienna.</small></p>
|
|
57
|
+
|
|
58
|
+
[](https://github.com/NatLabRockies/R2X/actions/workflows/ci.yaml) [](https://pypi.org/project/r2x/) [](https://pypi.org/project/r2x/) [](https://natlabrockies.github.io/R2X/) [](./LICENSE.txt)
|
|
59
|
+
|
|
60
|
+
<br clear="left">
|
|
61
|
+
|
|
62
|
+
R2X maps parsed power-system components and time series into a target model.
|
|
63
|
+
The [`r2x-cli`](https://github.com/NatLabRockies/r2x-cli) manages plugins and runs
|
|
64
|
+
pipelines. [`r2x-core`](https://github.com/NatLabRockies/r2x-core) supplies the
|
|
65
|
+
shared system, configuration, and rule APIs.
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
For Python integration, create and activate a supported Python environment, then
|
|
70
|
+
install the translation package for your workflow:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
python -m pip install r2x-reeds-to-plexos
|
|
74
|
+
python -m pip check
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
For CLI pipelines, install [r2x-cli](https://github.com/NatLabRockies/r2x-cli#install)
|
|
78
|
+
and run `r2x install r2x-reeds-to-plexos` in its managed environment. See
|
|
79
|
+
[Getting started](https://natlabrockies.github.io/R2X/getting-started/installation/)
|
|
80
|
+
for runtime requirements, discovery checks, and your first workflow.
|
|
81
|
+
|
|
82
|
+
## Documentation
|
|
83
|
+
|
|
84
|
+
Use the guide that matches your task:
|
|
85
|
+
|
|
86
|
+
- [Installation](https://natlabrockies.github.io/R2X/getting-started/installation/): prerequisites, published packages, and verification.
|
|
87
|
+
- [First CLI pipeline](https://natlabrockies.github.io/R2X/tutorials/getting-started/): run and inspect your first pipeline.
|
|
88
|
+
- [Translation workflows](https://natlabrockies.github.io/R2X/how-to/): parse, translate, and export a model.
|
|
89
|
+
- [Property reference](https://natlabrockies.github.io/R2X/reference/reeds-to-plexos-properties/): inspect mappings and their source rules.
|
|
90
|
+
- [Architecture](https://natlabrockies.github.io/R2X/explanation/architecture/): understand package boundaries.
|
|
91
|
+
- [Development](https://natlabrockies.github.io/R2X/how-to/development/): run checks and maintain translations.
|
|
92
|
+
|
|
93
|
+
The site includes searchable current documentation and release archives.
|
|
94
|
+
|
|
95
|
+
## Translation Plugins
|
|
96
|
+
|
|
97
|
+
| Package | Direction |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| [`r2x-reeds-to-plexos`](packages/r2x-reeds-to-plexos) | ReEDS → PLEXOS |
|
|
100
|
+
| [`r2x-reeds-to-sienna`](packages/r2x-reeds-to-sienna) | ReEDS → Sienna |
|
|
101
|
+
| [`r2x-plexos-to-sienna`](packages/r2x-plexos-to-sienna) | PLEXOS → Sienna |
|
|
102
|
+
| [`r2x-sienna-to-plexos`](packages/r2x-sienna-to-plexos) | Sienna → PLEXOS |
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
From the repository root, install the development environment and run its checks:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
uv sync && uv run prek run --all-files --hook-stage pre-push
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
See [Development](docs/src/content/docs/how-to/development.mdx) for focused checks
|
|
113
|
+
and [the documentation README](docs/README.md) for the site build.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
BSD-3-Clause. See [LICENSE.txt](./LICENSE.txt).
|
r2x-2.3.0/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<img src="./docs/src/assets/r2x-logo-full-square.svg" alt="R2X framework logo" align="left" width="220px" height="220px" hspace="10"/>
|
|
2
|
+
<img align="left" alt="" width="0" height="220px" hspace="10"/>
|
|
3
|
+
|
|
4
|
+
#### R2X
|
|
5
|
+
<p><small>Translation plugins for ReEDS, PLEXOS, and Sienna.</small></p>
|
|
6
|
+
|
|
7
|
+
[](https://github.com/NatLabRockies/R2X/actions/workflows/ci.yaml) [](https://pypi.org/project/r2x/) [](https://pypi.org/project/r2x/) [](https://natlabrockies.github.io/R2X/) [](./LICENSE.txt)
|
|
8
|
+
|
|
9
|
+
<br clear="left">
|
|
10
|
+
|
|
11
|
+
R2X maps parsed power-system components and time series into a target model.
|
|
12
|
+
The [`r2x-cli`](https://github.com/NatLabRockies/r2x-cli) manages plugins and runs
|
|
13
|
+
pipelines. [`r2x-core`](https://github.com/NatLabRockies/r2x-core) supplies the
|
|
14
|
+
shared system, configuration, and rule APIs.
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
For Python integration, create and activate a supported Python environment, then
|
|
19
|
+
install the translation package for your workflow:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python -m pip install r2x-reeds-to-plexos
|
|
23
|
+
python -m pip check
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
For CLI pipelines, install [r2x-cli](https://github.com/NatLabRockies/r2x-cli#install)
|
|
27
|
+
and run `r2x install r2x-reeds-to-plexos` in its managed environment. See
|
|
28
|
+
[Getting started](https://natlabrockies.github.io/R2X/getting-started/installation/)
|
|
29
|
+
for runtime requirements, discovery checks, and your first workflow.
|
|
30
|
+
|
|
31
|
+
## Documentation
|
|
32
|
+
|
|
33
|
+
Use the guide that matches your task:
|
|
34
|
+
|
|
35
|
+
- [Installation](https://natlabrockies.github.io/R2X/getting-started/installation/): prerequisites, published packages, and verification.
|
|
36
|
+
- [First CLI pipeline](https://natlabrockies.github.io/R2X/tutorials/getting-started/): run and inspect your first pipeline.
|
|
37
|
+
- [Translation workflows](https://natlabrockies.github.io/R2X/how-to/): parse, translate, and export a model.
|
|
38
|
+
- [Property reference](https://natlabrockies.github.io/R2X/reference/reeds-to-plexos-properties/): inspect mappings and their source rules.
|
|
39
|
+
- [Architecture](https://natlabrockies.github.io/R2X/explanation/architecture/): understand package boundaries.
|
|
40
|
+
- [Development](https://natlabrockies.github.io/R2X/how-to/development/): run checks and maintain translations.
|
|
41
|
+
|
|
42
|
+
The site includes searchable current documentation and release archives.
|
|
43
|
+
|
|
44
|
+
## Translation Plugins
|
|
45
|
+
|
|
46
|
+
| Package | Direction |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| [`r2x-reeds-to-plexos`](packages/r2x-reeds-to-plexos) | ReEDS → PLEXOS |
|
|
49
|
+
| [`r2x-reeds-to-sienna`](packages/r2x-reeds-to-sienna) | ReEDS → Sienna |
|
|
50
|
+
| [`r2x-plexos-to-sienna`](packages/r2x-plexos-to-sienna) | PLEXOS → Sienna |
|
|
51
|
+
| [`r2x-sienna-to-plexos`](packages/r2x-sienna-to-plexos) | Sienna → PLEXOS |
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
From the repository root, install the development environment and run its checks:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv sync && uv run prek run --all-files --hook-stage pre-push
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
See [Development](docs/src/content/docs/how-to/development.mdx) for focused checks
|
|
62
|
+
and [the documentation README](docs/README.md) for the site build.
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
BSD-3-Clause. See [LICENSE.txt](./LICENSE.txt).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "r2x"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.3.0"
|
|
4
4
|
authors = [
|
|
5
5
|
{ name = "pesap", email = "pesap@users.noreply.github.com" },
|
|
6
6
|
{ name = "kodiobika", email = "kodiobika@users.noreply.github.com" },
|
|
@@ -53,15 +53,15 @@ dependencies = [
|
|
|
53
53
|
"r2x-plexos-to-sienna",
|
|
54
54
|
"r2x-reeds-to-plexos",
|
|
55
55
|
"r2x-reeds-to-sienna",
|
|
56
|
-
"r2x-core",
|
|
56
|
+
"r2x-core>=1.0.0,<2.0.0",
|
|
57
57
|
]
|
|
58
58
|
|
|
59
59
|
[project.urls]
|
|
60
60
|
Homepage = "https://github.com/NatlabRockies/r2x"
|
|
61
|
-
Documentation = "https://
|
|
61
|
+
Documentation = "https://natlabrockies.github.io/R2X/"
|
|
62
62
|
Repository = "https://github.com/NatlabRockies/r2x"
|
|
63
63
|
Issues = "https://github.com/NatlabRockies/r2x/issues"
|
|
64
|
-
Changelog = "https://
|
|
64
|
+
Changelog = "https://natlabrockies.github.io/R2X/reference/changelog/"
|
|
65
65
|
|
|
66
66
|
[dependency-groups]
|
|
67
67
|
dev = [
|
|
@@ -71,15 +71,14 @@ dev = [
|
|
|
71
71
|
"prek>=0.3.8",
|
|
72
72
|
"pytest>=8.3.0,<9.0.0",
|
|
73
73
|
"pytest-cov>=5.0.0,<8.0.0",
|
|
74
|
-
"r2x-core>=0.
|
|
75
|
-
"ruff>=0.6.8,<0.
|
|
74
|
+
"r2x-core>=1.0.0,<2.0.0",
|
|
75
|
+
"ruff>=0.6.8,<0.17.0",
|
|
76
76
|
"taplo>=0.9.3,<1.0.0",
|
|
77
77
|
"ty>=0.0.2",
|
|
78
78
|
]
|
|
79
|
-
docs = ["furo", "ghp-import", "myst-parser", "sphinx", "sphinx-copybutton"]
|
|
80
79
|
|
|
81
80
|
[build-system]
|
|
82
|
-
requires = ["uv_build>=0.8.22,<0.
|
|
81
|
+
requires = ["uv_build>=0.8.22,<0.13.0"]
|
|
83
82
|
build-backend = "uv_build"
|
|
84
83
|
|
|
85
84
|
[tool.uv]
|
|
@@ -90,9 +89,6 @@ r2x-sienna-to-plexos = { workspace = true }
|
|
|
90
89
|
r2x-plexos-to-sienna = { workspace = true }
|
|
91
90
|
r2x-reeds-to-plexos = { workspace = true }
|
|
92
91
|
r2x-reeds-to-sienna = { workspace = true }
|
|
93
|
-
r2x-plexos = { git = "https://github.com/NatLabRockies/r2x-plexos.git", branch = "main" }
|
|
94
|
-
r2x-sienna = { git = "https://github.com/NatLabRockies/r2x-sienna.git", branch = "main" }
|
|
95
|
-
r2x-reeds = { git = "https://github.com/NatLabRockies/r2x-reeds.git", branch = "main" }
|
|
96
92
|
|
|
97
93
|
[tool.uv.workspace]
|
|
98
94
|
members = ["packages/*"]
|
|
@@ -104,11 +100,14 @@ plugins = ["pydantic.mypy"]
|
|
|
104
100
|
mypy_path = ["packages/*"]
|
|
105
101
|
|
|
106
102
|
[tool.pytest.ini_options]
|
|
107
|
-
pythonpath = [
|
|
103
|
+
pythonpath = [
|
|
104
|
+
"src",
|
|
105
|
+
"packages/r2x-sienna-to-plexos/tests",
|
|
106
|
+
"packages/r2x-plexos-to-sienna/tests",
|
|
107
|
+
]
|
|
108
108
|
testpaths = ["tests", "packages"]
|
|
109
109
|
addopts = [
|
|
110
110
|
"--import-mode=importlib",
|
|
111
|
-
"--cov=packages",
|
|
112
111
|
"--cov-report=term-missing:skip-covered",
|
|
113
112
|
"--cov-report=html",
|
|
114
113
|
"--cov-report=json",
|
|
@@ -171,6 +170,7 @@ max-complexity = 10
|
|
|
171
170
|
|
|
172
171
|
|
|
173
172
|
[tool.coverage.run]
|
|
173
|
+
source = ["packages"]
|
|
174
174
|
omit = ["*/tests/*", "*/conftest.py"]
|
|
175
175
|
|
|
176
176
|
[tool.coverage.report]
|
r2x-2.2.0/PKG-INFO
DELETED
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: r2x
|
|
3
|
-
Version: 2.2.0
|
|
4
|
-
Summary: Translation Plugins for mainstream models.
|
|
5
|
-
Keywords: power-systems,energy-modeling,model-translation,reeds,plexos,sienna,plugin-architecture
|
|
6
|
-
Author: pesap, kodiobika, Vivienne Liu, Micah Webb, Kinshuk Panda, mcllerena, jarry7
|
|
7
|
-
Author-email: pesap <pesap@users.noreply.github.com>, kodiobika <kodiobika@users.noreply.github.com>, Vivienne Liu <vivienne.liu@nrel.gov>, Micah Webb <micahpw@user.noreply.github.com>, Kinshuk Panda <7632244+k1nshuk@users.noreply.github.com>, mcllerena <mcllerena@users.noreply.github.com>, jarry7 <27745389+jarry7@users.noreply.github.com>
|
|
8
|
-
License: BSD 3-Clause License
|
|
9
|
-
|
|
10
|
-
Copyright (c) 2024, Alliance for Sustainable Energy LLC, All rights reserved.
|
|
11
|
-
|
|
12
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
13
|
-
|
|
14
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
15
|
-
|
|
16
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
17
|
-
|
|
18
|
-
* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
19
|
-
|
|
20
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
21
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
22
|
-
Classifier: Intended Audience :: Developers
|
|
23
|
-
Classifier: Intended Audience :: Science/Research
|
|
24
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
25
|
-
Classifier: Natural Language :: English
|
|
26
|
-
Classifier: Operating System :: OS Independent
|
|
27
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
28
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
29
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
30
|
-
Classifier: Topic :: File Formats :: JSON
|
|
31
|
-
Classifier: Topic :: Scientific/Engineering
|
|
32
|
-
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
33
|
-
Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
|
|
34
|
-
Classifier: Topic :: Software Development :: Build Tools
|
|
35
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
36
|
-
Classifier: Typing :: Typed
|
|
37
|
-
Requires-Dist: r2x-sienna-to-plexos
|
|
38
|
-
Requires-Dist: r2x-plexos-to-sienna
|
|
39
|
-
Requires-Dist: r2x-reeds-to-plexos
|
|
40
|
-
Requires-Dist: r2x-reeds-to-sienna
|
|
41
|
-
Requires-Dist: r2x-core
|
|
42
|
-
Maintainer: pesap, Kinshuk Panda, mcllerena, jarry7, kodiobika
|
|
43
|
-
Maintainer-email: pesap <pesap@users.noreply.github.com>, Kinshuk Panda <7632244+k1nshuk@users.noreply.github.com>, mcllerena <mcllerena@users.noreply.github.com>, jarry7 <27745389+jarry7@users.noreply.github.com>, kodiobika <kodiobika@users.noreply.github.com>
|
|
44
|
-
Requires-Python: >=3.11, <3.14
|
|
45
|
-
Project-URL: Changelog, https://NatlabRockies.github.io/r2x/CHANGELOG.html
|
|
46
|
-
Project-URL: Documentation, https://NatlabRockies.github.io/r2x/
|
|
47
|
-
Project-URL: Homepage, https://github.com/NatlabRockies/r2x
|
|
48
|
-
Project-URL: Issues, https://github.com/NatlabRockies/r2x/issues
|
|
49
|
-
Project-URL: Repository, https://github.com/NatlabRockies/r2x
|
|
50
|
-
Description-Content-Type: text/markdown
|
|
51
|
-
|
|
52
|
-
<h1 align="center">R2X</h1>
|
|
53
|
-
<p align="center">
|
|
54
|
-
Translation plugins for power system models.<br>
|
|
55
|
-
ReEDS, PLEXOS, Sienna
|
|
56
|
-
</p>
|
|
57
|
-
|
|
58
|
-
<div align="center">
|
|
59
|
-
|
|
60
|
-
[](https://pypi.python.org/pypi/r2x)
|
|
61
|
-
[](https://github.com/NatlabRockies/r2x/actions/workflows/ci.yaml)
|
|
62
|
-
[](https://codecov.io/gh/NatlabRockies/r2x)
|
|
63
|
-
[](https://natlabrockies.github.io/R2X/)
|
|
64
|
-
[](./LICENSE.txt)
|
|
65
|
-
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<p align="center">
|
|
69
|
-
<a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#architecture">Architecture</a> · <a href="#translation-plugins">Plugins</a> · <a href="#ecosystem">Ecosystem</a> · <a href="#model-compatibility">Compatibility</a> · <a href="#documentation">Docs</a> · <a href="#contributing">Contributing</a>
|
|
70
|
-
</p>
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
This repo houses the translation plugins for the
|
|
75
|
-
[r2x](https://github.com/NatlabRockies/r2x-cli) ecosystem. The
|
|
76
|
-
[r2x-cli](https://github.com/NatlabRockies/r2x-cli) is the
|
|
77
|
-
orchestrator for all r2x plugins — parsers, transforms,
|
|
78
|
-
translations, and exporters. It discovers installed plugins, chains
|
|
79
|
-
them into pipelines, and manages Python environments.
|
|
80
|
-
|
|
81
|
-
The plugins in this repo handle the translation step: converting
|
|
82
|
-
a parsed source system into a target format. They sit between
|
|
83
|
-
parsers (like `reeds-parser` or `sienna-parser`) and exporters
|
|
84
|
-
(like `plexos-parser` or `sienna-exporter`), all of which are separate
|
|
85
|
-
packages the CLI can chain together.
|
|
86
|
-
|
|
87
|
-
Translations are driven by declarative JSON rules that map source
|
|
88
|
-
components to target components, with `@getter`-decorated functions
|
|
89
|
-
handling any derived values.
|
|
90
|
-
|
|
91
|
-
## Installation
|
|
92
|
-
|
|
93
|
-
### Prerequisites
|
|
94
|
-
|
|
95
|
-
- Python 3.11, 3.12, or 3.13
|
|
96
|
-
- The [`r2x-cli`](https://github.com/NatlabRockies/r2x-cli)
|
|
97
|
-
|
|
98
|
-
### Install the CLI
|
|
99
|
-
|
|
100
|
-
See the [`r2x-cli` README](https://github.com/NatlabRockies/r2x-cli)
|
|
101
|
-
for install instructions. The CLI manages its own Python environment
|
|
102
|
-
and handles plugin installation.
|
|
103
|
-
|
|
104
|
-
### Install a translation plugin
|
|
105
|
-
|
|
106
|
-
Each plugin is published independently on PyPI. The CLI pulls in
|
|
107
|
-
any required dependencies (model packages, `r2x-core`, etc.)
|
|
108
|
-
automatically:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
# Install via the CLI (recommended)
|
|
112
|
-
r2x install r2x-reeds-to-plexos
|
|
113
|
-
r2x install r2x-sienna-to-plexos
|
|
114
|
-
|
|
115
|
-
# Or install directly if managing your own environment
|
|
116
|
-
pip install r2x-reeds-to-plexos
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Available plugins:
|
|
120
|
-
|
|
121
|
-
| Plugin | PyPI |
|
|
122
|
-
| --- | --- |
|
|
123
|
-
| `r2x-reeds-to-plexos` | [](https://pypi.python.org/pypi/r2x-reeds-to-plexos) |
|
|
124
|
-
| `r2x-reeds-to-sienna` | [](https://pypi.python.org/pypi/r2x-reeds-to-sienna) |
|
|
125
|
-
| `r2x-plexos-to-sienna` | [](https://pypi.python.org/pypi/r2x-plexos-to-sienna) |
|
|
126
|
-
| `r2x-sienna-to-plexos` | [](https://pypi.python.org/pypi/r2x-sienna-to-plexos) |
|
|
127
|
-
|
|
128
|
-
> [!TIP]
|
|
129
|
-
> We recommend [uv](https://docs.astral.sh/uv/) if you are managing
|
|
130
|
-
> Python environments yourself.
|
|
131
|
-
|
|
132
|
-
## Quick Start
|
|
133
|
-
|
|
134
|
-
### Using the CLI
|
|
135
|
-
|
|
136
|
-
The `r2x` CLI discovers all installed plugins automatically:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
# List every plugin the CLI can see (parsers, transforms, translations, exporters)
|
|
140
|
-
r2x list
|
|
141
|
-
|
|
142
|
-
# Scaffold a pipeline template
|
|
143
|
-
r2x init
|
|
144
|
-
|
|
145
|
-
# Run a named pipeline
|
|
146
|
-
r2x run pipeline.yaml my-pipeline
|
|
147
|
-
|
|
148
|
-
# Preview without writing output
|
|
149
|
-
r2x run pipeline.yaml my-pipeline --dry-run
|
|
150
|
-
|
|
151
|
-
# Run a single plugin directly
|
|
152
|
-
r2x run plugin reeds-parser --show-help
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
A `pipeline.yaml` chains plugins from across the ecosystem.
|
|
156
|
-
Parsers, translations, and exporters can all live in the same
|
|
157
|
-
pipeline — the CLI pipes each step's output into the next:
|
|
158
|
-
|
|
159
|
-
```yaml
|
|
160
|
-
variables:
|
|
161
|
-
run_folder: /path/to/reeds/run
|
|
162
|
-
output_dir: output
|
|
163
|
-
|
|
164
|
-
pipelines:
|
|
165
|
-
reeds-to-plexos:
|
|
166
|
-
- r2x-reeds.reeds-parser # from r2x-reeds
|
|
167
|
-
- r2x-reeds-to-plexos.translation # from this repo
|
|
168
|
-
- r2x-plexos.plexos-exporter # from r2x-plexos
|
|
169
|
-
|
|
170
|
-
config:
|
|
171
|
-
reeds-parser:
|
|
172
|
-
run_folder: ${run_folder}
|
|
173
|
-
solve_year: 2050
|
|
174
|
-
weather_year: 2012
|
|
175
|
-
plexos:
|
|
176
|
-
output: ${output_dir}
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### Using the Python API
|
|
180
|
-
|
|
181
|
-
Each translation plugin exposes a `perform_translation` function
|
|
182
|
-
that takes a `PluginContext` and returns a translated `System`:
|
|
183
|
-
|
|
184
|
-
```python
|
|
185
|
-
import json
|
|
186
|
-
from importlib.resources import files
|
|
187
|
-
|
|
188
|
-
from r2x_core import PluginContext, Rule, System, apply_rules_to_context
|
|
189
|
-
from r2x_core.logger import setup_logging
|
|
190
|
-
|
|
191
|
-
setup_logging(level="INFO")
|
|
192
|
-
|
|
193
|
-
# Build a context with your source system and config
|
|
194
|
-
context = PluginContext(config=my_config)
|
|
195
|
-
context.source_system = source_system # parsed ReEDS/PLEXOS/Sienna system
|
|
196
|
-
|
|
197
|
-
# Load and apply translation rules
|
|
198
|
-
rules_path = files("r2x_reeds_to_plexos.config") / "rules.json"
|
|
199
|
-
context.rules = Rule.from_records(json.loads(rules_path.read_text()))
|
|
200
|
-
|
|
201
|
-
# Run the rule engine
|
|
202
|
-
result = apply_rules_to_context(context)
|
|
203
|
-
result.summary() # prints a rich table of per-rule results
|
|
204
|
-
|
|
205
|
-
translated_system = context.target_system
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
See each plugin's README under [`packages/`](./packages) for
|
|
209
|
-
complete examples.
|
|
210
|
-
|
|
211
|
-
## Architecture
|
|
212
|
-
|
|
213
|
-
```mermaid
|
|
214
|
-
graph LR
|
|
215
|
-
subgraph "r2x-cli · Rust"
|
|
216
|
-
CLI[Pipeline Runner]
|
|
217
|
-
end
|
|
218
|
-
|
|
219
|
-
subgraph "Parsers"
|
|
220
|
-
RP[reeds-parser]
|
|
221
|
-
PP[plexos]
|
|
222
|
-
SP[sienna-parser]
|
|
223
|
-
end
|
|
224
|
-
|
|
225
|
-
subgraph "Transforms"
|
|
226
|
-
TR[add-ccs-credit<br/>add-imports<br/>break-gens<br/>...]
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
subgraph "Translations · this repo"
|
|
230
|
-
T1[reeds-to-plexos]
|
|
231
|
-
T2[reeds-to-sienna]
|
|
232
|
-
T3[plexos-to-sienna]
|
|
233
|
-
T4[sienna-to-plexos]
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
subgraph "Exporters"
|
|
237
|
-
EP[plexos]
|
|
238
|
-
ES[sienna-exporter]
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
CLI --> RP & PP & SP
|
|
242
|
-
CLI --> TR
|
|
243
|
-
CLI --> T1 & T2 & T3 & T4
|
|
244
|
-
CLI --> EP & ES
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
The CLI runs any package that registers plugins via the `r2x_plugin`
|
|
248
|
-
entry point. It discovers them with `r2x list` and re-scans with
|
|
249
|
-
`r2x sync`.
|
|
250
|
-
|
|
251
|
-
A typical pipeline flows through three stages:
|
|
252
|
-
|
|
253
|
-
1. Parse — a parser plugin reads source data and produces an
|
|
254
|
-
`r2x_core.System` (e.g. `reeds-parser` from
|
|
255
|
-
[r2x-reeds](https://github.com/NatlabRockies/r2x-reeds)).
|
|
256
|
-
2. Translate — a translation plugin (this repo) applies JSON rules
|
|
257
|
-
that map source components to target components, with `@getter`
|
|
258
|
-
functions for computed fields.
|
|
259
|
-
3. Export — an exporter plugin writes the translated `System` to
|
|
260
|
-
the output format (e.g. `plexos` from
|
|
261
|
-
[r2x-plexos](https://github.com/NatlabRockies/r2x-plexos)).
|
|
262
|
-
|
|
263
|
-
Transform plugins (like `add-ccs-credit` or `break-gens` from
|
|
264
|
-
[r2x-reeds](https://github.com/NatlabRockies/r2x-reeds)) can be
|
|
265
|
-
inserted anywhere in the pipeline to modify a system in place.
|
|
266
|
-
|
|
267
|
-
## Translation Plugins
|
|
268
|
-
|
|
269
|
-
| Package | Direction | Rules |
|
|
270
|
-
| --- | --- | ---: |
|
|
271
|
-
| [`r2x-reeds-to-plexos`](./packages/r2x-reeds-to-plexos) | ReEDS → PLEXOS | 34 |
|
|
272
|
-
| [`r2x-reeds-to-sienna`](./packages/r2x-reeds-to-sienna) | ReEDS → Sienna | — |
|
|
273
|
-
| [`r2x-plexos-to-sienna`](./packages/r2x-plexos-to-sienna) | PLEXOS → Sienna | 21 |
|
|
274
|
-
| [`r2x-sienna-to-plexos`](./packages/r2x-sienna-to-plexos) | Sienna → PLEXOS | 44 |
|
|
275
|
-
|
|
276
|
-
Each plugin contains:
|
|
277
|
-
|
|
278
|
-
- `translation.py` — `perform_translation(context)` entry point
|
|
279
|
-
- `config/rules.json` — source → target component mappings
|
|
280
|
-
- `getters.py` — `@getter`-decorated functions for computed fields
|
|
281
|
-
- `plugin.py` — registers the plugin via `PluginManifest`
|
|
282
|
-
|
|
283
|
-
<details>
|
|
284
|
-
<summary>Example rule (ReEDS thermal generator → PLEXOS generator)</summary>
|
|
285
|
-
|
|
286
|
-
```json
|
|
287
|
-
{
|
|
288
|
-
"source_type": "ReEDSThermalGenerator",
|
|
289
|
-
"target_type": "PLEXOSGenerator",
|
|
290
|
-
"version": 1,
|
|
291
|
-
"field_map": {
|
|
292
|
-
"name": "name",
|
|
293
|
-
"max_capacity": "capacity",
|
|
294
|
-
"fuel_price": "fuel_price",
|
|
295
|
-
"heat_rate": "heat_rate"
|
|
296
|
-
},
|
|
297
|
-
"getters": {
|
|
298
|
-
"units": "get_component_units",
|
|
299
|
-
"commit": "get_commitment_status",
|
|
300
|
-
"forced_outage_rate": "forced_outage_rate_percent"
|
|
301
|
-
},
|
|
302
|
-
"defaults": {
|
|
303
|
-
"category": "thermal",
|
|
304
|
-
"start_cost": 0.0
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
</details>
|
|
310
|
-
|
|
311
|
-
## Ecosystem
|
|
312
|
-
|
|
313
|
-
The r2x ecosystem is a set of independently published packages.
|
|
314
|
-
The CLI orchestrates them; `r2x-core` provides the shared plugin
|
|
315
|
-
framework; model packages supply parsers, exporters, and data
|
|
316
|
-
models; and this repo provides translation plugins.
|
|
317
|
-
|
|
318
|
-
| Package | Description |
|
|
319
|
-
| --- | --- |
|
|
320
|
-
| [r2x-cli](https://github.com/NatlabRockies/r2x-cli) | Rust CLI that discovers, installs, and runs any r2x plugin. Chains plugins into pipelines and manages Python environments |
|
|
321
|
-
| [r2x-core](https://github.com/NatlabRockies/r2x-core) | Shared plugin framework: `PluginContext`, `Rule`, `System`, `@getter` registry, `Result[T, E]` via [rust-ok](https://github.com/NatlabRockies/rust-ok) |
|
|
322
|
-
| [r2x-reeds](https://github.com/NatlabRockies/r2x-reeds) | ReEDS parser, transform plugins (`add-ccs-credit`, `break-gens`, etc.), and component models |
|
|
323
|
-
| [r2x-plexos](https://github.com/NatlabRockies/r2x-plexos) | PLEXOS parser/exporter and component models, built on [plexosdb](https://github.com/NatlabRockies/plexosdb) |
|
|
324
|
-
| [r2x-sienna](https://github.com/NatlabRockies/r2x-sienna) | Sienna parser/exporter and [PowerSystems.jl](https://github.com/Sienna-Platform/PowerSystems.jl)-compatible models |
|
|
325
|
-
| [infrasys](https://github.com/NatlabRockies/infrasys) | Foundational `System` container, time series management, and component storage used by all model packages |
|
|
326
|
-
| [plexosdb](https://github.com/NatlabRockies/plexosdb) | Standalone PLEXOS XML database reader/writer |
|
|
327
|
-
|
|
328
|
-
## Model Compatibility
|
|
329
|
-
|
|
330
|
-
| R2X Version | Supported Inputs | Supported Outputs |
|
|
331
|
-
| --- | --- | --- |
|
|
332
|
-
| 2.0 | ReEDS (v2024.8.0) | PLEXOS (9.0, 9.2, 10, 11) |
|
|
333
|
-
| | Sienna (PSY 4.0) | Sienna (PSY 4.0, 5.0) |
|
|
334
|
-
| | PLEXOS (9.0, 9.2, 10, 11) | |
|
|
335
|
-
|
|
336
|
-
## Documentation
|
|
337
|
-
|
|
338
|
-
Full docs, API reference, and how-to guides:
|
|
339
|
-
[natlabrockies.github.io/R2X](https://natlabrockies.github.io/R2X/)
|
|
340
|
-
|
|
341
|
-
## Roadmap
|
|
342
|
-
|
|
343
|
-
- [Active issues](https://github.com/NatlabRockies/R2X/issues?q=is%3Aopen+is%3Aissue+label%3A%22Working+on+it+%F0%9F%92%AA%22+sort%3Aupdated-asc):
|
|
344
|
-
Currently in progress.
|
|
345
|
-
- [Prioritized backlog](https://github.com/NatlabRockies/R2X/issues?q=is%3Aopen+is%3Aissue+label%3ABacklog):
|
|
346
|
-
Up next.
|
|
347
|
-
- [Nice-to-have](https://github.com/NatlabRockies/R2X/labels/Optional):
|
|
348
|
-
Community contributions welcome.
|
|
349
|
-
- [Ideas](https://github.com/NatlabRockies/R2X/issues?q=is%3Aopen+is%3Aissue+label%3AIdea):
|
|
350
|
-
Future directions for R2X.
|
|
351
|
-
|
|
352
|
-
## Contributing
|
|
353
|
-
|
|
354
|
-
Contributions are welcome! See the
|
|
355
|
-
[documentation](https://natlabrockies.github.io/R2X/) for coding
|
|
356
|
-
standards and PR guidelines.
|
|
357
|
-
|
|
358
|
-
```bash
|
|
359
|
-
git clone https://github.com/NatlabRockies/R2X.git
|
|
360
|
-
cd R2X
|
|
361
|
-
uv sync --dev
|
|
362
|
-
uv run pytest
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
## License
|
|
366
|
-
|
|
367
|
-
R2X is released under the
|
|
368
|
-
[BSD 3-Clause License](./LICENSE.txt).
|
|
369
|
-
|
|
370
|
-
Developed under software record SWR-24-91 at the
|
|
371
|
-
[National Laboratory of the Rockies](https://www.nlr.gov/) (NLR).
|
r2x-2.2.0/README.md
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
<h1 align="center">R2X</h1>
|
|
2
|
-
<p align="center">
|
|
3
|
-
Translation plugins for power system models.<br>
|
|
4
|
-
ReEDS, PLEXOS, Sienna
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<div align="center">
|
|
8
|
-
|
|
9
|
-
[](https://pypi.python.org/pypi/r2x)
|
|
10
|
-
[](https://github.com/NatlabRockies/r2x/actions/workflows/ci.yaml)
|
|
11
|
-
[](https://codecov.io/gh/NatlabRockies/r2x)
|
|
12
|
-
[](https://natlabrockies.github.io/R2X/)
|
|
13
|
-
[](./LICENSE.txt)
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<p align="center">
|
|
18
|
-
<a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#architecture">Architecture</a> · <a href="#translation-plugins">Plugins</a> · <a href="#ecosystem">Ecosystem</a> · <a href="#model-compatibility">Compatibility</a> · <a href="#documentation">Docs</a> · <a href="#contributing">Contributing</a>
|
|
19
|
-
</p>
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
This repo houses the translation plugins for the
|
|
24
|
-
[r2x](https://github.com/NatlabRockies/r2x-cli) ecosystem. The
|
|
25
|
-
[r2x-cli](https://github.com/NatlabRockies/r2x-cli) is the
|
|
26
|
-
orchestrator for all r2x plugins — parsers, transforms,
|
|
27
|
-
translations, and exporters. It discovers installed plugins, chains
|
|
28
|
-
them into pipelines, and manages Python environments.
|
|
29
|
-
|
|
30
|
-
The plugins in this repo handle the translation step: converting
|
|
31
|
-
a parsed source system into a target format. They sit between
|
|
32
|
-
parsers (like `reeds-parser` or `sienna-parser`) and exporters
|
|
33
|
-
(like `plexos-parser` or `sienna-exporter`), all of which are separate
|
|
34
|
-
packages the CLI can chain together.
|
|
35
|
-
|
|
36
|
-
Translations are driven by declarative JSON rules that map source
|
|
37
|
-
components to target components, with `@getter`-decorated functions
|
|
38
|
-
handling any derived values.
|
|
39
|
-
|
|
40
|
-
## Installation
|
|
41
|
-
|
|
42
|
-
### Prerequisites
|
|
43
|
-
|
|
44
|
-
- Python 3.11, 3.12, or 3.13
|
|
45
|
-
- The [`r2x-cli`](https://github.com/NatlabRockies/r2x-cli)
|
|
46
|
-
|
|
47
|
-
### Install the CLI
|
|
48
|
-
|
|
49
|
-
See the [`r2x-cli` README](https://github.com/NatlabRockies/r2x-cli)
|
|
50
|
-
for install instructions. The CLI manages its own Python environment
|
|
51
|
-
and handles plugin installation.
|
|
52
|
-
|
|
53
|
-
### Install a translation plugin
|
|
54
|
-
|
|
55
|
-
Each plugin is published independently on PyPI. The CLI pulls in
|
|
56
|
-
any required dependencies (model packages, `r2x-core`, etc.)
|
|
57
|
-
automatically:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
# Install via the CLI (recommended)
|
|
61
|
-
r2x install r2x-reeds-to-plexos
|
|
62
|
-
r2x install r2x-sienna-to-plexos
|
|
63
|
-
|
|
64
|
-
# Or install directly if managing your own environment
|
|
65
|
-
pip install r2x-reeds-to-plexos
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Available plugins:
|
|
69
|
-
|
|
70
|
-
| Plugin | PyPI |
|
|
71
|
-
| --- | --- |
|
|
72
|
-
| `r2x-reeds-to-plexos` | [](https://pypi.python.org/pypi/r2x-reeds-to-plexos) |
|
|
73
|
-
| `r2x-reeds-to-sienna` | [](https://pypi.python.org/pypi/r2x-reeds-to-sienna) |
|
|
74
|
-
| `r2x-plexos-to-sienna` | [](https://pypi.python.org/pypi/r2x-plexos-to-sienna) |
|
|
75
|
-
| `r2x-sienna-to-plexos` | [](https://pypi.python.org/pypi/r2x-sienna-to-plexos) |
|
|
76
|
-
|
|
77
|
-
> [!TIP]
|
|
78
|
-
> We recommend [uv](https://docs.astral.sh/uv/) if you are managing
|
|
79
|
-
> Python environments yourself.
|
|
80
|
-
|
|
81
|
-
## Quick Start
|
|
82
|
-
|
|
83
|
-
### Using the CLI
|
|
84
|
-
|
|
85
|
-
The `r2x` CLI discovers all installed plugins automatically:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
# List every plugin the CLI can see (parsers, transforms, translations, exporters)
|
|
89
|
-
r2x list
|
|
90
|
-
|
|
91
|
-
# Scaffold a pipeline template
|
|
92
|
-
r2x init
|
|
93
|
-
|
|
94
|
-
# Run a named pipeline
|
|
95
|
-
r2x run pipeline.yaml my-pipeline
|
|
96
|
-
|
|
97
|
-
# Preview without writing output
|
|
98
|
-
r2x run pipeline.yaml my-pipeline --dry-run
|
|
99
|
-
|
|
100
|
-
# Run a single plugin directly
|
|
101
|
-
r2x run plugin reeds-parser --show-help
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
A `pipeline.yaml` chains plugins from across the ecosystem.
|
|
105
|
-
Parsers, translations, and exporters can all live in the same
|
|
106
|
-
pipeline — the CLI pipes each step's output into the next:
|
|
107
|
-
|
|
108
|
-
```yaml
|
|
109
|
-
variables:
|
|
110
|
-
run_folder: /path/to/reeds/run
|
|
111
|
-
output_dir: output
|
|
112
|
-
|
|
113
|
-
pipelines:
|
|
114
|
-
reeds-to-plexos:
|
|
115
|
-
- r2x-reeds.reeds-parser # from r2x-reeds
|
|
116
|
-
- r2x-reeds-to-plexos.translation # from this repo
|
|
117
|
-
- r2x-plexos.plexos-exporter # from r2x-plexos
|
|
118
|
-
|
|
119
|
-
config:
|
|
120
|
-
reeds-parser:
|
|
121
|
-
run_folder: ${run_folder}
|
|
122
|
-
solve_year: 2050
|
|
123
|
-
weather_year: 2012
|
|
124
|
-
plexos:
|
|
125
|
-
output: ${output_dir}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Using the Python API
|
|
129
|
-
|
|
130
|
-
Each translation plugin exposes a `perform_translation` function
|
|
131
|
-
that takes a `PluginContext` and returns a translated `System`:
|
|
132
|
-
|
|
133
|
-
```python
|
|
134
|
-
import json
|
|
135
|
-
from importlib.resources import files
|
|
136
|
-
|
|
137
|
-
from r2x_core import PluginContext, Rule, System, apply_rules_to_context
|
|
138
|
-
from r2x_core.logger import setup_logging
|
|
139
|
-
|
|
140
|
-
setup_logging(level="INFO")
|
|
141
|
-
|
|
142
|
-
# Build a context with your source system and config
|
|
143
|
-
context = PluginContext(config=my_config)
|
|
144
|
-
context.source_system = source_system # parsed ReEDS/PLEXOS/Sienna system
|
|
145
|
-
|
|
146
|
-
# Load and apply translation rules
|
|
147
|
-
rules_path = files("r2x_reeds_to_plexos.config") / "rules.json"
|
|
148
|
-
context.rules = Rule.from_records(json.loads(rules_path.read_text()))
|
|
149
|
-
|
|
150
|
-
# Run the rule engine
|
|
151
|
-
result = apply_rules_to_context(context)
|
|
152
|
-
result.summary() # prints a rich table of per-rule results
|
|
153
|
-
|
|
154
|
-
translated_system = context.target_system
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
See each plugin's README under [`packages/`](./packages) for
|
|
158
|
-
complete examples.
|
|
159
|
-
|
|
160
|
-
## Architecture
|
|
161
|
-
|
|
162
|
-
```mermaid
|
|
163
|
-
graph LR
|
|
164
|
-
subgraph "r2x-cli · Rust"
|
|
165
|
-
CLI[Pipeline Runner]
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
subgraph "Parsers"
|
|
169
|
-
RP[reeds-parser]
|
|
170
|
-
PP[plexos]
|
|
171
|
-
SP[sienna-parser]
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
subgraph "Transforms"
|
|
175
|
-
TR[add-ccs-credit<br/>add-imports<br/>break-gens<br/>...]
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
subgraph "Translations · this repo"
|
|
179
|
-
T1[reeds-to-plexos]
|
|
180
|
-
T2[reeds-to-sienna]
|
|
181
|
-
T3[plexos-to-sienna]
|
|
182
|
-
T4[sienna-to-plexos]
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
subgraph "Exporters"
|
|
186
|
-
EP[plexos]
|
|
187
|
-
ES[sienna-exporter]
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
CLI --> RP & PP & SP
|
|
191
|
-
CLI --> TR
|
|
192
|
-
CLI --> T1 & T2 & T3 & T4
|
|
193
|
-
CLI --> EP & ES
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
The CLI runs any package that registers plugins via the `r2x_plugin`
|
|
197
|
-
entry point. It discovers them with `r2x list` and re-scans with
|
|
198
|
-
`r2x sync`.
|
|
199
|
-
|
|
200
|
-
A typical pipeline flows through three stages:
|
|
201
|
-
|
|
202
|
-
1. Parse — a parser plugin reads source data and produces an
|
|
203
|
-
`r2x_core.System` (e.g. `reeds-parser` from
|
|
204
|
-
[r2x-reeds](https://github.com/NatlabRockies/r2x-reeds)).
|
|
205
|
-
2. Translate — a translation plugin (this repo) applies JSON rules
|
|
206
|
-
that map source components to target components, with `@getter`
|
|
207
|
-
functions for computed fields.
|
|
208
|
-
3. Export — an exporter plugin writes the translated `System` to
|
|
209
|
-
the output format (e.g. `plexos` from
|
|
210
|
-
[r2x-plexos](https://github.com/NatlabRockies/r2x-plexos)).
|
|
211
|
-
|
|
212
|
-
Transform plugins (like `add-ccs-credit` or `break-gens` from
|
|
213
|
-
[r2x-reeds](https://github.com/NatlabRockies/r2x-reeds)) can be
|
|
214
|
-
inserted anywhere in the pipeline to modify a system in place.
|
|
215
|
-
|
|
216
|
-
## Translation Plugins
|
|
217
|
-
|
|
218
|
-
| Package | Direction | Rules |
|
|
219
|
-
| --- | --- | ---: |
|
|
220
|
-
| [`r2x-reeds-to-plexos`](./packages/r2x-reeds-to-plexos) | ReEDS → PLEXOS | 34 |
|
|
221
|
-
| [`r2x-reeds-to-sienna`](./packages/r2x-reeds-to-sienna) | ReEDS → Sienna | — |
|
|
222
|
-
| [`r2x-plexos-to-sienna`](./packages/r2x-plexos-to-sienna) | PLEXOS → Sienna | 21 |
|
|
223
|
-
| [`r2x-sienna-to-plexos`](./packages/r2x-sienna-to-plexos) | Sienna → PLEXOS | 44 |
|
|
224
|
-
|
|
225
|
-
Each plugin contains:
|
|
226
|
-
|
|
227
|
-
- `translation.py` — `perform_translation(context)` entry point
|
|
228
|
-
- `config/rules.json` — source → target component mappings
|
|
229
|
-
- `getters.py` — `@getter`-decorated functions for computed fields
|
|
230
|
-
- `plugin.py` — registers the plugin via `PluginManifest`
|
|
231
|
-
|
|
232
|
-
<details>
|
|
233
|
-
<summary>Example rule (ReEDS thermal generator → PLEXOS generator)</summary>
|
|
234
|
-
|
|
235
|
-
```json
|
|
236
|
-
{
|
|
237
|
-
"source_type": "ReEDSThermalGenerator",
|
|
238
|
-
"target_type": "PLEXOSGenerator",
|
|
239
|
-
"version": 1,
|
|
240
|
-
"field_map": {
|
|
241
|
-
"name": "name",
|
|
242
|
-
"max_capacity": "capacity",
|
|
243
|
-
"fuel_price": "fuel_price",
|
|
244
|
-
"heat_rate": "heat_rate"
|
|
245
|
-
},
|
|
246
|
-
"getters": {
|
|
247
|
-
"units": "get_component_units",
|
|
248
|
-
"commit": "get_commitment_status",
|
|
249
|
-
"forced_outage_rate": "forced_outage_rate_percent"
|
|
250
|
-
},
|
|
251
|
-
"defaults": {
|
|
252
|
-
"category": "thermal",
|
|
253
|
-
"start_cost": 0.0
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
</details>
|
|
259
|
-
|
|
260
|
-
## Ecosystem
|
|
261
|
-
|
|
262
|
-
The r2x ecosystem is a set of independently published packages.
|
|
263
|
-
The CLI orchestrates them; `r2x-core` provides the shared plugin
|
|
264
|
-
framework; model packages supply parsers, exporters, and data
|
|
265
|
-
models; and this repo provides translation plugins.
|
|
266
|
-
|
|
267
|
-
| Package | Description |
|
|
268
|
-
| --- | --- |
|
|
269
|
-
| [r2x-cli](https://github.com/NatlabRockies/r2x-cli) | Rust CLI that discovers, installs, and runs any r2x plugin. Chains plugins into pipelines and manages Python environments |
|
|
270
|
-
| [r2x-core](https://github.com/NatlabRockies/r2x-core) | Shared plugin framework: `PluginContext`, `Rule`, `System`, `@getter` registry, `Result[T, E]` via [rust-ok](https://github.com/NatlabRockies/rust-ok) |
|
|
271
|
-
| [r2x-reeds](https://github.com/NatlabRockies/r2x-reeds) | ReEDS parser, transform plugins (`add-ccs-credit`, `break-gens`, etc.), and component models |
|
|
272
|
-
| [r2x-plexos](https://github.com/NatlabRockies/r2x-plexos) | PLEXOS parser/exporter and component models, built on [plexosdb](https://github.com/NatlabRockies/plexosdb) |
|
|
273
|
-
| [r2x-sienna](https://github.com/NatlabRockies/r2x-sienna) | Sienna parser/exporter and [PowerSystems.jl](https://github.com/Sienna-Platform/PowerSystems.jl)-compatible models |
|
|
274
|
-
| [infrasys](https://github.com/NatlabRockies/infrasys) | Foundational `System` container, time series management, and component storage used by all model packages |
|
|
275
|
-
| [plexosdb](https://github.com/NatlabRockies/plexosdb) | Standalone PLEXOS XML database reader/writer |
|
|
276
|
-
|
|
277
|
-
## Model Compatibility
|
|
278
|
-
|
|
279
|
-
| R2X Version | Supported Inputs | Supported Outputs |
|
|
280
|
-
| --- | --- | --- |
|
|
281
|
-
| 2.0 | ReEDS (v2024.8.0) | PLEXOS (9.0, 9.2, 10, 11) |
|
|
282
|
-
| | Sienna (PSY 4.0) | Sienna (PSY 4.0, 5.0) |
|
|
283
|
-
| | PLEXOS (9.0, 9.2, 10, 11) | |
|
|
284
|
-
|
|
285
|
-
## Documentation
|
|
286
|
-
|
|
287
|
-
Full docs, API reference, and how-to guides:
|
|
288
|
-
[natlabrockies.github.io/R2X](https://natlabrockies.github.io/R2X/)
|
|
289
|
-
|
|
290
|
-
## Roadmap
|
|
291
|
-
|
|
292
|
-
- [Active issues](https://github.com/NatlabRockies/R2X/issues?q=is%3Aopen+is%3Aissue+label%3A%22Working+on+it+%F0%9F%92%AA%22+sort%3Aupdated-asc):
|
|
293
|
-
Currently in progress.
|
|
294
|
-
- [Prioritized backlog](https://github.com/NatlabRockies/R2X/issues?q=is%3Aopen+is%3Aissue+label%3ABacklog):
|
|
295
|
-
Up next.
|
|
296
|
-
- [Nice-to-have](https://github.com/NatlabRockies/R2X/labels/Optional):
|
|
297
|
-
Community contributions welcome.
|
|
298
|
-
- [Ideas](https://github.com/NatlabRockies/R2X/issues?q=is%3Aopen+is%3Aissue+label%3AIdea):
|
|
299
|
-
Future directions for R2X.
|
|
300
|
-
|
|
301
|
-
## Contributing
|
|
302
|
-
|
|
303
|
-
Contributions are welcome! See the
|
|
304
|
-
[documentation](https://natlabrockies.github.io/R2X/) for coding
|
|
305
|
-
standards and PR guidelines.
|
|
306
|
-
|
|
307
|
-
```bash
|
|
308
|
-
git clone https://github.com/NatlabRockies/R2X.git
|
|
309
|
-
cd R2X
|
|
310
|
-
uv sync --dev
|
|
311
|
-
uv run pytest
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
## License
|
|
315
|
-
|
|
316
|
-
R2X is released under the
|
|
317
|
-
[BSD 3-Clause License](./LICENSE.txt).
|
|
318
|
-
|
|
319
|
-
Developed under software record SWR-24-91 at the
|
|
320
|
-
[National Laboratory of the Rockies](https://www.nlr.gov/) (NLR).
|
|
File without changes
|
|
File without changes
|