use pyo3::prelude::*;
mod array;
mod error;
mod interpolation;
mod objective;
mod path;
mod robot;
mod solver;
const MODULE_DOC: &str = r#"Python bindings for copp-py.
Install the distribution as `copp-py`. The public Python module is imported as:
import copp_py as copp
This native extension contains the low-level PyO3 bindings for COPP path
construction, robot and constraint modeling, interpolation utilities,
objective terms, Clarabel-backed optimization helpers, and the TOPP/COPP
solver families exposed by the Python package. Most users should import with
`import copp_py as copp` and use public Python namespaces through that alias,
such as `copp.path`, `copp.robot`, `copp.constraints`, `copp.objective`,
`copp.interpolation`, `copp.clarabel`, and `copp.solver.*` instead of
importing this module directly.
Numerical inputs accept NumPy-compatible ArrayLike values and are copied into
contiguous float64 buffers at the wrapper boundary. Python-level format errors,
such as invalid array dimensionality or mutually exclusive keyword arguments,
are reported as ValueError. Errors returned by the Rust COPP core are reported
as copp.CoppError and typed subclasses such as copp.PathError and
copp.ConstraintError.
"#;
#[pyfunction]
fn version() -> &'static str {
env!("CARGO_PKG_VERSION")
}
#[pymodule]
#[pyo3(name = "_native")]
pub fn native(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add("__doc__", MODULE_DOC)?;
m.add("__version__", env!("CARGO_PKG_VERSION"))?;
error::register(m)?;
m.add_function(wrap_pyfunction!(version, m)?)?;
interpolation::register(m)?;
path::register(m)?;
objective::register(m)?;
robot::register(m)?;
solver::register(m)?;
Ok(())
}