Skip to content

Commit

Permalink
Pyomo 6
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed May 21, 2021
1 parent 54f438d commit 6aef09a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 28 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/pyotracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
- name: set up pyomo
run: |
git clone https://github.com/PyUtilib/pyutilib.git
cd pyutilib && python ./setup.py develop && cd ..
git clone https://github.com/pyomo/pyomo
cd pyomo && python setup.py develop
Expand Down
5 changes: 1 addition & 4 deletions docker-actions/weekly/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ RUN pip install xpress
RUN apt update
RUN apt install -y git-all

# get pyutilib and pyomo from the web
RUN git clone https://github.com/PyUtilib/pyutilib.git
RUN cd pyutilib && python ./setup.py develop && cd ..
# (the last cd .. is probably not needed)
# get pyomo from the web

RUN git clone https://github.com/pyomo/pyomo

Expand Down
9 changes: 1 addition & 8 deletions mpisppy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# Copyright 2020 by B. Knueven, D. Mildebrath, C. Muir, J-P Watson, and D.L. Woodruff
# This software is distributed under the 3-clause BSD License.

import pyomo as _pyo

pyomo6 = (int(_pyo.__version__[0]) >= 6)

if pyomo6:
from pyomo.common.timing import TicTocTimer as _TTT
else:
from pyutilib.misc.timing import TicTocTimer as _TTT
from pyomo.common.timing import TicTocTimer as _TTT

try:
import mpi4py.MPI as _mpi
Expand Down
17 changes: 5 additions & 12 deletions mpisppy/utils/pysp_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@

import mpisppy

if mpisppy.pyomo6:
from pysp.scenariotree.tree_structure_model import \
CreateAbstractScenarioTreeModel, ScenarioTreeModelFromNetworkX
from pysp.phutils import isVariableNameIndexed,\
extractVariableNameAndIndex
from pyomo.common.fileutils import import_file
else:
from pyomo.pysp.scenariotree.tree_structure_model import \
CreateAbstractScenarioTreeModel, ScenarioTreeModelFromNetworkX
from pyomo.pysp.phutils import isVariableNameIndexed,\
extractVariableNameAndIndex
from pyutilib.misc.import_file import import_file
from pysp.scenariotree.tree_structure_model import \
CreateAbstractScenarioTreeModel, ScenarioTreeModelFromNetworkX
from pysp.phutils import isVariableNameIndexed,\
extractVariableNameAndIndex
from pyomo.common.fileutils import import_file

from mpisppy.scenario_tree import ScenarioNode as mpisppyScenarioNode
from mpisppy.utils.sputils import create_EF as create_mpisppy_EF
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
mpi4py>=3.0.3
numpy>=1.19
pyutilib>=6.0
pyomo>=5.7.1
pyomo>=6.0
scipy>=1.5

0 comments on commit 6aef09a

Please sign in to comment.