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 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.1.3.tar.gz (50.9 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.1.3-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polar_high-1.1.3.tar.gz
  • Upload date:
  • Size: 50.9 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.1.3.tar.gz
Algorithm Hash digest
SHA256 d96456b9fe2421fd0559fe177794ba4a4a7920f1028b8e316cd7c9f240cf995e
MD5 6e9af86cf580e6c21380061df7a35c23
BLAKE2b-256 fbc6af0bae7b11e870ec9492c221c7867236adda0bd20db794491206199772c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for polar_high-1.1.3.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.1.3-py3-none-any.whl.

File metadata

  • Download URL: polar_high-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 41.6 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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 11ce2b057f6e0b09b428d0f776f001f4fca0f407f2dbccc91f438c85a6f3c077
MD5 afbd5d5e00d2a0232bf28e4f1a953037
BLAKE2b-256 e74265ecc2dae0bbde6c997aa71dab52c5930ac7c45c3bf22cd56161e0a62f3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for polar_high-1.1.3-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