Python library for building indexed linear and mixed-integer programs in polars; assembles into HiGHS, exportable as MPS.
Project description
polar-high
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polar_high-1.1.4.tar.gz.
File metadata
- Download URL: polar_high-1.1.4.tar.gz
- Upload date:
- Size: 54.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad3e6737dc296f38f71c5b82370a9ad62c8200eefe50d0220a6d78acecd28712
|
|
| MD5 |
9acd9c5cd20de42f998e2aeba5130e2a
|
|
| BLAKE2b-256 |
488212163ff68411ae7fa4be5879af70d401c838784b27b05b7bce604d68bf10
|
Provenance
The following attestation bundles were made for polar_high-1.1.4.tar.gz:
Publisher:
release.yml on nodal-tools/polar-high
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polar_high-1.1.4.tar.gz -
Subject digest:
ad3e6737dc296f38f71c5b82370a9ad62c8200eefe50d0220a6d78acecd28712 - Sigstore transparency entry: 1517729357
- Sigstore integration time:
-
Permalink:
nodal-tools/polar-high@897cafd837df462a44f9a65c0d04c4cf24d605ee -
Branch / Tag:
refs/tags/v1.1.4 - Owner: https://github.com/nodal-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@897cafd837df462a44f9a65c0d04c4cf24d605ee -
Trigger Event:
push
-
Statement type:
File details
Details for the file polar_high-1.1.4-py3-none-any.whl.
File metadata
- Download URL: polar_high-1.1.4-py3-none-any.whl
- Upload date:
- Size: 44.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ce9955faef727fb4fc39f1f15e27fed5e422b4289fc48fe6e72e79ce69c74e7
|
|
| MD5 |
02a919f709030f24be362ab944efc79f
|
|
| BLAKE2b-256 |
567548ac419fa6293d0cefadbb74a3bd96ad624524c0d5bd6363e0e362316cde
|
Provenance
The following attestation bundles were made for polar_high-1.1.4-py3-none-any.whl:
Publisher:
release.yml on nodal-tools/polar-high
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polar_high-1.1.4-py3-none-any.whl -
Subject digest:
8ce9955faef727fb4fc39f1f15e27fed5e422b4289fc48fe6e72e79ce69c74e7 - Sigstore transparency entry: 1517729420
- Sigstore integration time:
-
Permalink:
nodal-tools/polar-high@897cafd837df462a44f9a65c0d04c4cf24d605ee -
Branch / Tag:
refs/tags/v1.1.4 - Owner: https://github.com/nodal-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@897cafd837df462a44f9a65c0d04c4cf24d605ee -
Trigger Event:
push
-
Statement type: