Skip to content

Verify installation and first use

After installing the published package, check the version and construct an empty system:

Terminal window
python -c "import r2x_core; from r2x_core import System; system = System(); print(r2x_core.__version__); print(type(system).__name__)"

Expect the installed version followed by System. In a uv project, prefix the same command with uv run. An import failure usually means the command is using a different environment; see Troubleshooting.

Next, build and verify a CSV capacity scenario. That worked example ships its own data and uses the repository’s locked runtime to keep the fixture and implementation aligned. It verifies a 165 MW system and reloads the exported artifact in a fresh process. For method contracts and source links, use the API reference.

r2x-core provides infrastructure and registers no runnable CLI plugins of its own. Model packages provide native input parsers, modifiers and exporters; r2x-cli installs and discovers those packages. The contracts you implement depend on the work:

WorkPublic contractNext step
Read native data into a systemPlugin.on_build() returns Result[System, str]Build a parser
Modify a systemon_transform() or an exposed System, config callableCreate a function plugin
Translate component schemason_translate() and rule mappingsApply rules
Write model-specific outputon_export()Build an exporter

A model package may call a modifier a sysmod; that name is not a built-in electrical operation in this library. Use the package’s registered reference and configuration instead of guessing a class or CLI command. For native model inputs, start with r2x-reeds or the model package linked from the R2X architecture guide.