Skip to main content

Python library for building indexed linear and mixed-integer programs in polars; assembles into HiGHS, exportable as MPS.

Project description

polar-high

PyPI Python versions License tests docs Ruff

A Python library for building and solving large linear and mixed-integer optimisation programs, i.e. domain specific language (DSL) for algebraic modelling. Variables and parameters are polars DataFrames, expressions are joined and grouped lazily, and the matrix is assembled directly through HiGHS — or exported as MPS for any other LP/MIP solver. The kernel is intentionally domain-free: it has no opinions about energy systems, supply chains, or any specific application.

Install

pip install polar-high

Requires Python 3.11+. HiGHS ships in highspy, no separate install.

Quickstart

A tiny dispatch LP — wind + coal over three hours, minimise cost subject to capacity and per-hour demand.

--8<-- "tests/fixtures/quickstart_example.py:model"

Documentation

Full docs at https://nodal-tools.fi/polar-high/ — published with MkDocs + mike for per-version reads.

  • Concepts — the indexed-frame mental model (Var, Param, Sum, Where, Lag, broadcasting/join semantics).
  • Guide — warm-starting, Lagrangian decomposition, performance tuning, debugging.
  • API reference — autogenerated from docstrings.
  • Compare — how polar-high relates to Pyomo, JuMP, gurobipy, linopy, and GNU MathProg.

Build locally: pip install -e ".[docs]" && mkdocs serve.

Used by

polar-high is the build engine behind the FlexTool energy-system modelling toolkit (still in dev branch only, 7.5.2026 situation). FlexTool's fleet of system tests (from earlier GNU MathProg to HiGHS implementation) has been used to test polar-high in real modelling use cases. In addition polar-high kernel has its own set of unit and system tests.

Created by

polar-high was created by Juha Kiviluoma of Nodal-Tools using Claude Opus.

License

Apache-2.0 — see LICENSE and NOTICE. Changelog: CHANGELOG.md.

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

polar_high-1.2.0.tar.gz (100.2 kB view details)

Uploaded Source

Built Distribution

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

polar_high-1.2.0-py3-none-any.whl (86.3 kB view details)

Uploaded Python 3

File details

Details for the file polar_high-1.2.0.tar.gz.

File metadata

  • Download URL: polar_high-1.2.0.tar.gz
  • Upload date:
  • Size: 100.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polar_high-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3a724b0cf0a4c4b022184409e745977f596a9749bcad69754cacde8451bdfb1b
MD5 4e36247d84b4ff01a510fe118a976b82
BLAKE2b-256 82d2f33f386f44f7391a2a387c52f3898362a652e270022a34b64cccb0bb1d7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for polar_high-1.2.0.tar.gz:

Publisher: release.yml on nodal-tools/polar-high

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

File details

Details for the file polar_high-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: polar_high-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 86.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polar_high-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1d3a84cfc1c4db2b1464a52b251dce6cf2b47740160a1dd40b7ab55f3f980ba
MD5 776450b32331f34c8403b0f410e9c943
BLAKE2b-256 5965b15121c8cd414f1ab2dc9230381590e15d2f81ff15bb2158ea58e3ab6c79

See more details on using hashes here.

Provenance

The following attestation bundles were made for polar_high-1.2.0-py3-none-any.whl:

Publisher: release.yml on nodal-tools/polar-high

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