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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uma-1.0.tar.gz.
File metadata
- Download URL: uma-1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35bd18cb49b5eb1dfd35454a75c684737968db80896f0c492bec11a4fba1ca64
|
|
| MD5 |
89abd6440fbf5b83eea22f2078b01e08
|
|
| BLAKE2b-256 |
1d6ec7d14711c9bc6db0b6394844eb03367a1626dde4924003eb5186f4374e3d
|
File details
Details for the file uma-1.0-py3-none-any.whl.
File metadata
- Download URL: uma-1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5f006211257552287d9f4e69a86d0a1f893457fdd126553412690d84891fc1e
|
|
| MD5 |
98f78db78d8e06b9bfdf9da240a5aa3b
|
|
| BLAKE2b-256 |
0282b8b4e477555217b6af12b4b5c087dc4dce8d93f9eed773d082aef161d74a
|