Skip to main content

cobre

Python bindings for the Cobre power systems solver.

Cobre is a high-performance SDDP (Stochastic Dual Dynamic Programming) solver for hydrothermal dispatch, written in Rust. This package provides Python access to case loading, validation, training, simulation, and result inspection.

Installation

pip install cobre-python

Pre-built wheels are available for:

  • Linux x86_64 (manylinux_2_34)
  • Linux aarch64 (manylinux_2_28)
  • Linux musl x86_64 (musllinux_1_2)
  • macOS Apple Silicon (aarch64) and Intel (x86_64)
  • Windows x86_64
  • Python 3.12+

Quick Start

import cobre

# Load and validate a case
system = cobre.io.load_case("path/to/case")
print(f"System: {system.n_buses} buses, {system.n_hydros} hydros, {system.n_thermals} thermals")

# Run training + simulation
result = cobre.run.run("path/to/case", output_dir="output/")
print(f"Converged: {result['converged']}, LB: {result['lower_bound']:.2f}")

convergence = cobre.results.load_convergence("output/")
print(f"Iterations: {len(convergence)}")

simulation = cobre.results.load_simulation("output/")
print(f"Cost records: {len(simulation['costs'])}")

policy = cobre.results.load_policy("output/")
print(f"Iterations completed: {policy['metadata']['producer']['completed_iterations']}")

The same workflow, driven step by step:

# The Study lifecycle — construct, train, simulate
study = cobre.Study("path/to/case", output_dir="output/")
policy = study.train()
summary = study.simulate(policy)
print(f"Scenarios: {summary['n_scenarios']}, Completed: {summary['completed']}")

# Inspect the study before running any phase
print(f"Stages: {study.stochastic['n_stages']}, Seed: {study.stochastic['seed']}")

Modules

  • cobre.io — Load and validate case directories
  • cobre.model — Data model classes (System, Bus, Line, Thermal, Hydro, etc.)
  • cobre.run — Execute SDDP training and simulation
  • cobre.results — Load and inspect output artifacts, including convergence history, Parquet simulation outputs, and FlatBuffers policy (FCF) checkpoints
  • cobre.schema — JSON Schema export for case-directory input types
  • cobre.errors — Typed exception hierarchy for case-loading and solver errors

The package also exports Study, Policy, write_policy_checkpoint, and version_info at the top level.

Requirements

  • Python >= 3.12
  • No runtime dependencies (the Rust solver is statically linked)

License

Apache-2.0 — see LICENSE.

Metadata

Release files for cobre-python 0.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for cobre-python 0.16.0
File
cobre_python-0.16.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
cobre_python-0.16.0-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details
cobre_python-0.16.0-cp312-abi3-manylinux_2_34_x86_64.whl CPython 3.12 abi3 Linux glibc 2.34+ x86-64 Details
cobre_python-0.16.0-cp312-abi3-manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64 Details
cobre_python-0.16.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
cobre_python-0.16.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details

Total release size: 57.8 MB

Release files / cobre_python-0.16.0-cp312-abi3-win_amd64.whl

Download URL cobre_python-0.16.0-cp312-abi3-win_amd64.whl
Size 7.7 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e51167f0e1188279e55e8fb0df911629990269f407597f2f05047d6102db3de7
BLAKE2b-256 checksum
How to use checksums
788a6f92a8faf1d23a9a7bd028b24fd74f4afb3651dd318f50216078560febcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / cobre_python-0.16.0-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL cobre_python-0.16.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 15.6 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
0300de3ee18fd3e6dfcaa851d0d391ea477edb3403a9845f27e47c9efb03fca1
BLAKE2b-256 checksum
How to use checksums
632e8716f1edd5baa289e1d30858116e515bd93662a89e831fc1d124d4c0d729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / cobre_python-0.16.0-cp312-abi3-manylinux_2_34_x86_64.whl

Download URL cobre_python-0.16.0-cp312-abi3-manylinux_2_34_x86_64.whl
Size 9.2 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
2b22c4f9abf5811eaab11f6d1d4691834ed2cb579a88b52f7a15b4c466c24d00
BLAKE2b-256 checksum
How to use checksums
7fc1e764a9992f6552e86ab04addb788f410ca19ee1a764cc092544650d27ac2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / cobre_python-0.16.0-cp312-abi3-manylinux_2_28_aarch64.whl

Download URL cobre_python-0.16.0-cp312-abi3-manylinux_2_28_aarch64.whl
Size 8.7 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
70889018e6e6e19d73f0cc8863e518bd13933e8c4c7ce46d1b8e834dcbed56a7
BLAKE2b-256 checksum
How to use checksums
d0718c4ad0db9dc18d85a0a0bb1ca5f7e602bbffdae270fd68d7f1a30affc84a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / cobre_python-0.16.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL cobre_python-0.16.0-cp312-abi3-macosx_11_0_arm64.whl
Size 7.9 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ccb409f95cca706568239996c02e223dee7985f74b6253493f5db6a459d22b36
BLAKE2b-256 checksum
How to use checksums
788c57710ff4216db435b40a6940d43209bd6e1b92fd6f9ecb923518a192b28d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / cobre_python-0.16.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL cobre_python-0.16.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 8.6 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b50ada60c1af6bbc71760114f40532084a0b0016c47daa9991ec6e6650560577
BLAKE2b-256 checksum
How to use checksums
012ea24dbcb4fb9c97a03afa478df443d7a5b786184259924c7a038c4d33805f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.16.0 This release

6 release files

0.15.0

6 release files

0.14.3

6 release files

0.14.2

6 release files

0.14.1

6 release files

0.14.0

6 release files

0.13.0

6 release files

0.12.0

6 release files

0.11.1

6 release files

0.11.0

6 release files

0.10.0

6 release files

0.9.1

6 release files

0.9.0

6 release files

0.8.2

6 release files

0.8.1

6 release files

0.8.0

6 release files

0.7.0

6 release files

0.6.2

6 release files

0.6.1

6 release files

0.6.0

6 release files

0.5.1

6 release files

0.5.0

6 release files

0.4.4

6 release files

0.4.3

6 release files

0.4.2

6 release files

0.4.1

9 release files

0.4.0

9 release files

0.3.2

9 release files

0.3.1

9 release files

0.3.0

9 release files

0.2.2

9 release files

0.2.1

9 release files

0.2.0

9 release files

0.1.11

9 release files

0.1.10

9 release files

0.1.9

9 release files

0.1.8

9 release files

0.1.7

9 release files

0.1.6

9 release files

0.1.5

9 release files

0.1.4

9 release files

0.1.3

9 release files

0.1.2

9 release files

0.1.1

9 release files

0.1.0

9 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page