Skip to main content

Python bindings for Arco optimization library

Project description

Arco Python bindings

The Python package remains in bindings/python for path compatibility with existing build, release, and editable-install workflows. Its Rust crate is named arco-python and is the Python interaction surface; public Python imports stay under arco.

Python-facing solve orchestration is routed through the shared arco-ops facade where it overlaps with other interaction surfaces. The public Python API is unchanged.

Build and install locally with uv:

cd bindings/python
uv sync --group dev
uv run --with maturin maturin develop

To enable the IPOPT nonlinear backend, build with the ipopt feature (requires a system IPOPT install):

cd bindings/python
uv run --with maturin maturin develop --features ipopt

Run linting:

uv run ruff check .
uv run ty check .

Run Python example formulations from the repository root:

cd ../..
uv run examples/dense-lp/formulation.py --solve --json
uv run examples/sdom/formulation.py --solve --json

For interactive exploration of dense-lp (no extra script boilerplate):

cd ../..
uv run --with ipython --with-editable ./bindings/python ipython -i examples/dense-lp/formulation.py

Inside IPython, use model to inspect the formulation and call solve() when ready.

Running example problems

The examples/ tree contains standalone Python scripts that build models directly through the bindings, covering different problem classes:

  • LP — linear programs (default HiGHS backend).
  • MILP — mixed-integer linear programs (HiGHS).
  • NLP — nonlinear programs (requires bindings built with --features ipopt).
  • QP / QCP — (quadratically constrained) quadratic programs, solved through the appropriate backend for the problem class.

Run from bindings/python so the locally built extension is on the import path:

cd bindings/python

# LP — Multi-period DC-OPF (HiGHS)
uv run python ../../examples/multi-period-optimal-power-flow/dc-opf-24bus-wind-load-shedding/problem.py

# NLP — Multi-period AC-OPF (IPOPT)
uv run python ../../examples/multi-period-optimal-power-flow/ac-opf-24bus-wind-load-shedding/problem.py

Each script prints the solver status and final objective value alongside the reference value from the original formulation. Substitute the path to any other problem.py (or formulation.py) under examples/ to run a different model.

Project details


Download files

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

Source Distribution

arco-0.6.1.tar.gz (379.0 kB view details)

Uploaded Source

Built Distribution

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

arco-0.6.1-cp312-cp312-manylinux_2_38_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.38+ x86-64

File details

Details for the file arco-0.6.1.tar.gz.

File metadata

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

File hashes

Hashes for arco-0.6.1.tar.gz
Algorithm Hash digest
SHA256 9d550d47b75f31feda4262050389518c543f3327e5cb3e992ad04c1db8525683
MD5 dba60ea9606d919d594ad7ef0e343417
BLAKE2b-256 1c3a37ee7f21da18f7324fdd96343b063a44df228dff2cdc5d92aac3085bc5c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.6.1.tar.gz:

Publisher: pypi-manual-release.yaml on NatLabRockies/arco

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

File details

Details for the file arco-0.6.1-cp312-cp312-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for arco-0.6.1-cp312-cp312-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 3c74bbe5f679c5f6ebf3da8e39936411efe0842ea2b1d0d1631d4a382cd88b03
MD5 49174015b87ef648860da8f44eeaa457
BLAKE2b-256 60337b7f33bf53ced0d725139f2c6fd86d05bb49a8fb316bc39186f5dde80edb

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.6.1-cp312-cp312-manylinux_2_38_x86_64.whl:

Publisher: release-please.yaml on NatLabRockies/arco

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