Skip to main content

PyomoTools

PyomoTools is a collection of tools to aid in formulating and working with Pyomo models.

Key functions include:

  • LoadIndexedSet: Create a dict of subsets and properly attach it to a given pyomo model. (available to environ models only)
  • Load2DIndexedSet: Similar to LoadIndexedSet but with two levels of indexing. (available to environ models only)
  • GenerateExpressionStrings: A function to create a matching pair of strings representing a given pyomo expression: One symbolic, One with all values substituted in
  • InfeasibilityReport: A class to analyze any infeasibilities found within a model in an easily readable way.
  • Formulations.DoubleSidedBigM: A function to automatically generate the constraints and variables needed to model the relation $A = B \times X + C$ in MILP form.
  • Formulations.MinOperator: A function to automatically generate the constraints and variables needed to model the relation $A = min(B,C)$ in MILP form.
  • Formulations.MaxOperator: A function to automatically generate the constraints and variables needed to model the relation $A = max(B,C)$ in MILP form.
  • Formulations.PWL: A function to automatically generate a Piecewise-Linear approximation of a general (non-linear) function (available to environ models only) (pyomo kernel already has this functionality)
  • IO.ModelToExcel: A function to write the solution of a model to an easily readable excel file. (available to environ models only)
  • IO.LoadModelSolutionFromExcel: A function to load a solution from an excel file into a pyomo model. (available to environ models only)
  • IO.ModelToYaml: A function to write the solution of a model to a yaml file. (available to kernel models only)
  • IO.LoadSolutionFromYaml: A function to load a solution from a yaml file into a pyomo model. (available to kernel models only)
  • FindLeastInfeasibleSolution: A tool for finding the least infeasible solution of a (presumably infeasible) model.
  • VectorRepresentation: A tool to convert a (Mixed-Integer) Linear model into it's vector/matrix representation.
  • Polytope: A class to facilitate the plotting and vertex calculation of a sub-polytope of a model.

Each function is available (or will soon be available) for both pyomo.environ modeling as well as pyomo.kernel modeling. To access each one, please import them from PyomoTools.environ or PyomoTools.kernel

Installation

From PyPi

1.1. Enter the command pip install PyomoTools in your Python terminal.

From GitHub

1.1. Download or clone this repository.
1.2. In your Python terminal, navigate to the repository you downloaded.
1.3. Enter the command pip install .

  1. By default, the example/testing code used into this package uses the SCIP solver, Gurobi Solver, and ipopt Solver. Please either
    A) ensure that these solvers are installed and accessible to Pyomo or
    B) call PyomoTools.base.Solvers.DefaultSolver.EditDefaultSolver(problemType,solverName,**defaultKwargs) where
    problemType is MILP, NLP, MIQCP, etc,\ solverName is the name of the solver you'd like to use (e.g. "gurobi", "ipopt"), and\ defaultKwargs are any necessary key-word arguments for pyomo to utilize (e.g. executable=path/to/executable)

  2. To make sure everything was correctly installed, Enter the command pytest PyomoTools/

Metadata

Release files for PyomoTools 0.3.7.3

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

Source distribution (sdist)

Source distribution for PyomoTools 0.3.7.3
File Size Uploaded
pyomotools-0.3.7.3.tar.gz 162.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyomoTools 0.3.7.3
File Interpreter ABI Platform
pyomotools-0.3.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 385.7 kB

Release files / pyomotools-0.3.7.3.tar.gz

Download URL pyomotools-0.3.7.3.tar.gz
Size 162.0 kB
Tags Source
SHA-256 checksum
How to use checksums
08213469fdf62f759c0e6280942ed972e34ae82e9bcb7cb9c0a1a44d35e175bc
BLAKE2b-256 checksum
How to use checksums
6f7f51ef0bb0d9f7a497768e6fc97156b7b27445343593cc4bb01b8191372391
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / pyomotools-0.3.7.3-py3-none-any.whl

Download URL pyomotools-0.3.7.3-py3-none-any.whl
Size 223.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
974e4c7df71ded047d2cced3e2dd73c3cac1ee27d2b8f6671d137be3d29c3c04
BLAKE2b-256 checksum
How to use checksums
96a6aea0802d798da46f13e127352bc7b9d7eef6bd4139073acffae84e517da1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release history Release notifications | RSS feed

This release

0.3.7.3 This release

2 release files

0.3.3

2 release files

0.3.1

2 release files

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