Skip to main content

Documentation Status PyPI Downloads Python package PyPI - Python Version

Gana is an Algebraic Modeling Language (AML) for Multiscale Modeling and Optimization. Generated programs (Prg) can be subclasses of Multiparametric Mixed Integer Linear Programming (mpMILP).

Installation

The current development checkout requires the Rust extension, gana._native. The Python modeling API is unchanged. Use Python 3.12 or 3.13 for the candidate validation matrix; other versions and wheel platforms are not yet verified.

Install an available release and its dependencies in a fresh environment:

python3.13 -m venv .venv
.venv/bin/python -m pip install gana

On Windows, use .venv\Scripts\python instead. Published releases may predate the backend retirement described here. A compatible wheel includes the native extension and needs no Rust compiler at runtime. A source installation, including this checkout, needs Rust/Cargo 1.88 or newer and a platform linker; validation uses Rust 1.88.0:

.venv/bin/python -m pip install .

Leave GANA_BACKEND unset. The old rust-parameters value is accepted as an alias; python and unknown values are rejected. A missing extension produces installation guidance instead of selecting a Python backend. See the installation guide and native implementation notes.

Features

Gana supports:

  • mutable elements, allowing constraints/functions to be updated dynamically
  • multiparametric as well as mixed integer programming
  • formulation in both matrix form and set-based mathematical program

Moreover, Gana uses a simple format to write constraints/functions.

Elements

Programs in Gana are written using element sets, namely:

  1. I - index
  2. V - variable
  3. P - parameter
  4. T - parametric variable

Solvers

The list of natively supported solvers are:

  1. PPOPT for multiparametric programming (mp)
  2. Gurobi for Mixed Integer Programming (MIP) Programs can, however, be exported as a .mps or .lp file and passed to most solvers.

Illustration

Gana is best run in Jupyter as notebook (.ipynb) files, where programs can be visualized as canonical mathematical programs using set-notation.

Additionally, matrices can be exported.

Purpose

Gana was developed to enable certain functionalities in energia (py). Both were developed as PhD projects and have ample room for improvement. So please reach out to me on cacodcar@gmail.com with suggestions and such.

Metadata

Release files for gana 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gana 1.1.0
File Size Uploaded Provenance Actions
gana-1.1.0.tar.gz 158.2 kB Without provenance Details for gana-1.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for gana 1.1.0
File Actions
gana-1.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for gana-1.1.0-cp312-abi3-win_amd64.whl
gana-1.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for gana-1.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
gana-1.1.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for gana-1.1.0-cp312-abi3-macosx_11_0_arm64.whl
gana-1.1.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for gana-1.1.0-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 2.1 MB

Release files / gana-1.1.0.tar.gz

Download URL gana-1.1.0.tar.gz
Size 158.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4e13f3309a056d183818d283b61cc4a30cb47597b01e9deae1b5f6f709b7af25
BLAKE2b-256 checksum
How to use checksums
26ed02825116bed8c992d7f5355b8b95e05f1a6355bf8660196ddc0724688c4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / gana-1.1.0-cp312-abi3-win_amd64.whl

Download URL gana-1.1.0-cp312-abi3-win_amd64.whl
Size 413.6 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
aed6dca8633a4e6a85070e9e4c21d4c64fd2f876a13270a5f606baf94769f1d9
BLAKE2b-256 checksum
How to use checksums
e1ad81dc8ea4679ddb6a429cbc9ccf9957be02db0ed25edc65302866c87da149
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / gana-1.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gana-1.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 550.1 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
290123af667b905107ada6f08e7930f5e956daf86168173a23ab312848c830c8
BLAKE2b-256 checksum
How to use checksums
3e354f78f14fdaeb0710a8b39f3ac26fee035b7c900ce4e5b79558c586da3c84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / gana-1.1.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL gana-1.1.0-cp312-abi3-macosx_11_0_arm64.whl
Size 500.2 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9804a84e892ab566cfd96c59f69bdc2a19d53223c9c3f74a265f4594eb454a3f
BLAKE2b-256 checksum
How to use checksums
a05435ee58be834d414ea5999cfb7261d3ff2085e18d777d8951ddebc0c54adf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / gana-1.1.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL gana-1.1.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 526.5 kB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f001aa869e1a4168775d27c9f46571d808bf7d73b85ffb06a10025d94414211d
BLAKE2b-256 checksum
How to use checksums
d63368e7aa0ea89be7d453d81bbaa175964e851edaff4048ea9d76b88ac6dbf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Security for gana 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page