cobre/lib.rs
1//! # cobre-python
2//!
3//! Python bindings for the [Cobre](https://github.com/cobre-rs/cobre) power systems solver.
4//!
5//! Exposes the Cobre solver as a Python extension module (`import cobre`),
6//! providing programmatic access to case loading, validation, training,
7//! simulation, and result inspection from Python scripts, Jupyter notebooks,
8//! and orchestration frameworks.
9//!
10//! ## Constraints
11//!
12//! - **Single-process only** — this crate MUST NOT initialize MPI or depend
13//! on `ferrompi`. The GIL/MPI incompatibility makes it unsafe to combine
14//! MPI initialization with Python embedding. For distributed execution,
15//! launch `mpiexec cobre` as a subprocess.
16//! - **GIL released during computation** — all Rust computation runs with
17//! the GIL released via `py.allow_threads()`, allowing OpenMP threads
18//! within `cobre-sddp` to run at full parallelism.
19//! - **No Python callbacks in the hot loop** — all customization is
20//! via configuration structs, not Python callables.
21//!
22//! ## Status
23//!
24//! This crate is in early development. The API **will** change.
25//!
26//! See the [repository](https://github.com/cobre-rs/cobre) for the full roadmap.