Metadata-Version: 2.4
Name: gana
Version: 1.0.3
Summary: A barebones mathematical programming package
Author-email: Rahul Kakodkar <cacodcar@gmail.com>
Maintainer-email: Rahul Kakodkar <cacodcar@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Rahul Kakodkar
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/cacodcar/gana
Project-URL: Issues, https://github.com/cacodcar/gana/issues
Keywords: modeling,optimization,programming,aml
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ppopt
Requires-Dist: gurobipy
Requires-Dist: IPython
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: matplotlib
Provides-Extra: all
Requires-Dist: pyomo; extra == "all"
Requires-Dist: sympy; extra == "all"
Provides-Extra: test
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: hypothesis; extra == "test"
Requires-Dist: flake8; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-book-theme; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: sphinx_mdinclude; extra == "docs"
Requires-Dist: myst-nb; extra == "docs"
Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-togglebutton; extra == "docs"
Requires-Dist: sphinx-thebe; extra == "docs"
Requires-Dist: sphinx-design; extra == "docs"
Requires-Dist: sphinx-examples; extra == "docs"
Requires-Dist: sphinx-tabs; extra == "docs"
Requires-Dist: sphinxext-opengraph; extra == "docs"
Dynamic: license-file


<p align="center">
  <img src="https://github.com/cacodcar/gana/raw/main/docs/_static/ganalogo.jpg" width="75%">
</p>


[![Documentation Status](https://readthedocs.org/projects/gana/badge/)](https://gana.readthedocs.io/en/latest/)
[![PyPI](https://img.shields.io/pypi/v/gana.svg)](https://pypi.org/project/gana)
[![Downloads](https://static.pepy.tech/personalized-badge/gana?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads)](https://pepy.tech/project/gana)
[![Python package](https://github.com/cacodcar/gana/actions/workflows/python-package.yml/badge.svg)](https://github.com/cacodcar/gana/actions/workflows/python-package.yml)


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). 

# 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](https://github.com/TAMUparametric/PPOPT) for multiparametric programming (mp)
2. [Gurobi](https://www.gurobi.com/) for Mixed Integer Programming (MIP)
Programs  can, however, be exported as a [.mps](https://www.ibm.com/docs/en/icos/22.1.2?topic=formats-working-mps-files) or [.lp](https://www.ibm.com/docs/en/icos/22.1.2?topic=formats-working-lp-files) file and passed to most solvers.


# Illustration

Gana is best run in [Jupyter](https://jupyter.org/) 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)](https://energiapy.readthedocs.io/en/latest/). 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. 

<!-- 
or 

Matrices can be generated to represent: 

LHS Parameter coefficient of variables in constraints: 
    1. A - all
    2. G - inequality 
    3. H - equality
    4. NN - nonnegativity

RHS parameters in constraints:
    1. B 

RHS Parameter coefficient of parametric variables in constraints:
    1. F 

Bounds of the parametric variables:
    1. CRa - RHS coefficients
    2. CRb - Bound (upper or lower) -->





