Skip to content
/ uma Public

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

License

Notifications You must be signed in to change notification settings

dgusain1/uma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages