Skip to main content

A python package to collect pyomo results as pandas dataframe for easier access.

Project description

uma

uma is a Python package to collect pyomo results as pandas dataframe for easier access.

Installation

uma can be installed from PyPI using:

pip install uma

uma requires numpy and pandas to work.

Usage

uma works if the model solution is optimal. If the solution is infeasible, an error will be returned.

from uma import get_df, get_dict, get_value
from pyomo.environ import * 
from pyomo.opt import SolverFactory

model = ConcreteModel() 
model.x = Var(initialize=-1.2, bounds=(-2, 2))
model.y = Var(initialize= 1.0, bounds=(-2, 2))
model.obj = Objective( expr= (1-model.x)**2 + 100*(model.y-model.x**2)**2, sense= minimize)

solver = SolverFactory('ipopt')
solver.solve(model)

df = get_df(model)
print(df.head())

dict1 = get_dict(model)
print(dict1)

x = get_value(model.x)
print(x)

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

uma-1.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

uma-1.0-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page