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 the repository solver setup:

just py-dev

Default Python builds include HiGHS, SCIP, and the runtime-loaded Xpress backend. Solving with arco.Xpress(...) still requires the FICO Xpress runtime and a valid license on the target machine.

For direct maturin workflows, run through the solver build environment so the bindings link against the cached HiGHS and SCIP distributions:

cd ../..
CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 ARCO_HIGHS_ENABLE_APPLE_STATIC=1 ./scripts/with_solver_build_env.sh \
  bash -lc 'cd bindings/python && uv sync --group dev && ./.venv/bin/maturin develop'

CARGO_INCREMENTAL=0 and CARGO_PROFILE_DEV_DEBUG=0 are intentional for cold editable builds: they avoid incremental bookkeeping and debug-info generation that slow a clean maturin develop build. Leave them unset for normal Rust edit-compile-test loops where incremental rebuilds and debug info help.

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

To disable optional commercial or native solver features for a source build, turn off default Cargo features and opt back into the backends you need:

cd bindings/python
uv run --with maturin maturin develop --no-default-features --features pyo3/extension-module

Without a solver feature, that solver's Python class remains importable but solve will fail fast with a rebuild hint.

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.8.2.tar.gz (416.6 kB view details)

Uploaded Source

Built Distributions

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

arco-0.8.2-cp311-cp311-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.11Windows x86-64

arco-0.8.2-cp311-cp311-manylinux_2_38_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.38+ x86-64

arco-0.8.2-cp311-cp311-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

arco-0.8.2-cp310-cp310-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.10Windows x86-64

arco-0.8.2-cp310-cp310-manylinux_2_38_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.38+ x86-64

arco-0.8.2-cp310-cp310-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for arco-0.8.2.tar.gz
Algorithm Hash digest
SHA256 70bc58170c961f8b2086ad63e5e0be550c2e3985ae577913fbcbab8224cc1f71
MD5 6aabcfb6394ea0fe97c6a514193b88a3
BLAKE2b-256 1f6ec0a12dbe1f4fa5ae2780134378e88c76a2687cfdd76b8391bdfb67a62478

See more details on using hashes here.

Provenance

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

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.

File details

Details for the file arco-0.8.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: arco-0.8.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for arco-0.8.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d6599bcb4e6c8de58d2a77e0681acc3049fcf05c3f456a08ba9e223b919148aa
MD5 df606cc8580d292294feb9cad35a588e
BLAKE2b-256 4cb6215615980bce3eca71a66b3e6e779bbe64fe94e9287500421640cbba5bca

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.8.2-cp311-cp311-win_amd64.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.

File details

Details for the file arco-0.8.2-cp311-cp311-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for arco-0.8.2-cp311-cp311-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 6d4fada1d3c250edce1ad4e485e44f072f89718b7c2897db37ac01382516534b
MD5 a34b36a733ae169f71163d860643237b
BLAKE2b-256 d6b0d491ed9371da961becc882e7aa260175f187fb0c64f1a1358d6a4095a8f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.8.2-cp311-cp311-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.

File details

Details for the file arco-0.8.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arco-0.8.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac245ee93e2cd215627b13a88f9fe642ffc8efdadead73bac34ae18e7747de18
MD5 85aaee17063212ba9c4a7cf05088c0a9
BLAKE2b-256 f968c2996502deb91a629219b6d738582326ac94292acd6bcc93608ade69a1fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.8.2-cp311-cp311-macosx_11_0_arm64.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.

File details

Details for the file arco-0.8.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: arco-0.8.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for arco-0.8.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1b898cce2d3829dbd5ff4cfd3ce2a8b9adfb1aea4a9c6d8224fc21403a30bbbf
MD5 4aa8c6298ce6e3565b551af2bc76a2fc
BLAKE2b-256 4074ee90adb2dffb87524264968e2e4228719d738fd5175b11acc4abbf7ffc80

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.8.2-cp310-cp310-win_amd64.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.

File details

Details for the file arco-0.8.2-cp310-cp310-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for arco-0.8.2-cp310-cp310-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 641493004bcf1702890ac078818dc6b5fd72f91cf3ee3acfa4fbe1b8dd51133e
MD5 2d9b383ff56cfb4ca7110a118a460f01
BLAKE2b-256 71cea0aa4bc99d3b216943826c74a3936a1f8a39047c1ad63d4ec0b71394a59e

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.8.2-cp310-cp310-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.

File details

Details for the file arco-0.8.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arco-0.8.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 caa79186f6080b41668f47da8b35f254bca407b9c5dfb7f296972c87e16c60bf
MD5 70d1aa5574b1cc85b78cfb86fbf2406e
BLAKE2b-256 3a54912d1685e5a497f5650a52bd156520c58f8eade72755a738ba789197e0da

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.8.2-cp310-cp310-macosx_11_0_arm64.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