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.1.4.tar.gz (815.2 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.1.4-py3-none-any.whl (832.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: r2x_plexos-0.1.4.tar.gz
  • Upload date:
  • Size: 815.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for r2x_plexos-0.1.4.tar.gz
Algorithm Hash digest
SHA256 37df059b0c9d9fecd0b68078cfcb38e5fdd3d1350f7f364a8bf0955f329abfa5
MD5 f855ca0dec3937d9f9fb83fa30c94125
BLAKE2b-256 314399172cfe9aaea9336843c1d0a5b5e2c17d5b44fbb14756547d4be0aed563

See more details on using hashes here.

File details

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

File metadata

  • Download URL: r2x_plexos-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 832.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for r2x_plexos-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 405640c16b7037e2c97693062e10cbe2cfa94a8df9f4a50d72efc38f976bb273
MD5 09b0e40cb246ed83b966a01976a0fe16
BLAKE2b-256 4d255268e5989754bd43860610dc78ec6c378325a28a779d04ecb2937e9ea696

See more details on using hashes here.

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