Pyomo¶
![]()
Pyomo is a Python-based, open-source optimization modeling language with a diverse set of optimization capabilities.
Get started¶
A community app is a great place to get started with the Pyomo integration. You can work with any solver that Pyomo supports. When running locally, be sure to install the solver you want to use separately (read Pyomo’s installation notes for more information).
Tip
Learn how to get started using community apps with our tutorial: Explore new model - CLI.
When running remotely on Nextmv Platform:
- If you are using a solver that is distributed via a Python package, use the
dependencies file in your project to install the solver and bundle the
dependency upon app push (e.g., for Gurobi use the
gurobipyPython package, and thegurobi_directprovider with theSolverFactory). Read more in theapp.yamlmanifest section. - If a solver needs a standalone installation, use the
ghcr.io/nextmv-io/runtime/pyomoruntime. This runtime comes with the following solvers pre-installed: - If you want to use a different solver with Pyomo on Nextmv Platform contact Nextmv support.
Make sure to specify the pyomo runtime in your app’s app.yaml manifest:
# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: python
runtime: ghcr.io/nextmv-io/runtime/pyomo:latest
# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
- main.py
python:
# Packages the app depends on need to be listed in a requirements.txt file
# that is referenced here. All listed packages will get bundled with the app.
pip-requirements: pyproject.toml # Can be a requirements.txt
configuration:
# Specify the format the app reads and writes.
content:
format: json # Read JSON from stdin and write JSON to stdout.
# Define the options (parameters) of the app.
options:
strict: false
items:
- name: duration
option_type: int
default: 30
description: Max runtime duration (in seconds).
required: false
additional_attributes:
min: 1
max: 300
step: 10
ui:
control_type: slider
display_name: Duration
- name: provider
option_type: string
default: cbc
description: Solver provider.
required: false
ui:
control_type: input
display_name: Provider
License¶
The Pyomo integration does not require additional licensing or setup (besides the solver), for running locally or remotely on Nextmv Platform.
Marketplace apps¶
The Pyomo Shift Assignment and Pyomo Shift Planning apps in Nextmv Marketplace use Pyomo.
Sign up for a free Nextmv Cloud account to test out the Pyomo Shift Assignment and Pyomo Shift Planning apps.