Skip to main content

Plexos Models, Parser and Exporter

Project description

r2x-plexos

R2X plug-in for translating to and from PLEXOS XML databases.

image image image CI codecov Ruff Documentation Docstring Coverage

R2X PLEXOS plugin for parsing and exporting PLEXOS power system models.

Quick Start

Installation

uv add r2x-plexos

Parsing PLEXOS XML

from pathlib import Path
from r2x_core import (
    DataFile,
    DataStore,
    PluginContext,
    Rule,
    System,
    apply_rules_to_context,
)
from r2x_plexos import PLEXOSParser, PLEXOSConfig

xml_path = /path/to/xml
db = PlexosDB.from_xml(xml_path)
model_names = db.list_objects_by_class(ClassEnum.Model)
model_name = model_names[1] if model_names else "Base"

plexos_config = PLEXOSConfig(
    model_name=model_name,
    horizon_year=2012,
    models=("r2x_plexos.models", "r2x_sienna.models"),)
data_file = DataFile(name="xml_file", fpath=xml_path)
store = DataStore(path=folder_path)
store.add_data([data_file])

context = PluginContext(
    config=plexos_config,
    store=store
)
parser = PLEXOSParser.from_context(context)
plexos_sys_result = parser.run()
plexos_sys = plexos_sys_result.system
context.source_system = plexos_sys

Documentation Sections

Roadmap

If you're curious about what we're working on, check out the roadmap:

  • Active issues: Issues that we are actively working on.
  • Prioritized backlog: Issues we'll be working on next.
  • Nice-to-have: Nice to have features or Issues to fix. Anyone can start working on (please let us know before you do).
  • Ideas: Future work or ideas for R2X Core.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

r2x_plexos-0.2.0.tar.gz (824.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

r2x_plexos-0.2.0-py3-none-any.whl (841.8 kB view details)

Uploaded Python 3

File details

Details for the file r2x_plexos-0.2.0.tar.gz.

File metadata

  • Download URL: r2x_plexos-0.2.0.tar.gz
  • Upload date:
  • Size: 824.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for r2x_plexos-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4c28799d7deda2416244d47fa8eb781b7f91f98d29f4205fcbb40545679aec54
MD5 893f4c2c296c193f8ed273b4d347f887
BLAKE2b-256 8315905a0005bd21786b60cfa59069add1c9df6ce50f5224c7317597d841e20b

See more details on using hashes here.

Provenance

The following attestation bundles were made for r2x_plexos-0.2.0.tar.gz:

Publisher: release.yaml on NatLabRockies/r2x-plexos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file r2x_plexos-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: r2x_plexos-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 841.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for r2x_plexos-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 361f28719688176efdd8b7dd5a1276089b117efb505bf4c118b6df5076d01606
MD5 7dad313d7c9d1d7d313b1aadfcb47730
BLAKE2b-256 d7e8e6f13a7e4f6e5cd446777a7d9728e88f1ccd311a3ceb0e58b0772e2b5705

See more details on using hashes here.

Provenance

The following attestation bundles were made for r2x_plexos-0.2.0-py3-none-any.whl:

Publisher: release.yaml on NatLabRockies/r2x-plexos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page