Skip to content

Commit

Permalink
Changing references to pyomo.solvers.plugins.smanager:
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Apr 6, 2021
1 parent 8b8df69 commit 4443fbf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pysp/drive_lagrangian_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run(args=None):
##########################================================#########
# to import plugins
import pyomo.environ
import pyomo.solvers.plugins.smanager.pyro
import pysp.pyro.smanager_pyro
import pysp.plugins.phpyro

def partialLagrangeParametric(args=None):
Expand Down
6 changes: 3 additions & 3 deletions pysp/ef_writer_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
IPySPSolutionLoaderExtension)
from pysp.solutionwriter import ISolutionWriterExtension
from pysp.ef import write_ef, create_ef_instance
import pysp.pyro.smanager_pyro

logger = logging.getLogger('pysp')

Expand Down Expand Up @@ -202,8 +203,7 @@ def close(self):
self.destroy_ef()
if self._solver_manager is not None:
if isinstance(self._solver_manager,
pyomo.solvers.plugins.smanager.\
pyro.SolverManager_Pyro):
pysp.pyro.smanager_pyro.SolverManager_Pyro):
if self.get_option("pyro_shutdown_workers"):
self._solver_manager.shutdown_workers()
self._solver_manager = None
Expand All @@ -220,7 +220,7 @@ def close(self):
self.solve_time = undefined

def __init__(self, manager, *args, **kwds):
import pyomo.solvers.plugins.smanager.pyro
import pysp.pyro.smanager_pyro
super(ExtensiveFormAlgorithm, self).__init__(*args, **kwds)

# TODO: after PH moves over to the new code
Expand Down
2 changes: 1 addition & 1 deletion pysp/ph.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
from pysp import phsolverserverutils

from pyomo.opt.parallel.local import SolverManager_Serial
import pyomo.solvers.plugins.smanager
import pysp.pyro.smanager_pyro

from six import iterkeys, itervalues, iteritems
from six.moves import xrange
Expand Down
10 changes: 5 additions & 5 deletions pysp/phinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def GenerateScenarioTreeForPH(options,
def PHAlgorithmBuilder(options, scenario_tree):

import pyomo.environ
import pyomo.solvers.plugins.smanager.pyro
import pysp.pyro.smanager_pyro
import pysp.plugins.phpyro

solution_writer_plugins = ExtensionPoint(ISolutionWriterExtension)
Expand Down Expand Up @@ -890,7 +890,7 @@ def PHAlgorithmBuilder(options, scenario_tree):
pysp.plugins.phpyro.SolverManager_PHPyro):
solver_manager.release_servers(shutdown=ph._shutdown_pyro_workers)
elif isinstance(solver_manager,
pyomo.solvers.plugins.smanager.pyro.SolverManager_Pyro):
pysp.pyro.smanager_pyro.SolverManager_Pyro):
if ph._shutdown_pyro_workers:
solver_manager.shutdown_workers()

Expand Down Expand Up @@ -973,14 +973,14 @@ def PHCleanup(ph):
if ph._solver_manager is not None:

import pyomo.environ
import pyomo.solvers.plugins.smanager.pyro
import pysp.pyro.smanager_pyro
import pysp.plugins.phpyro

if isinstance(ph._solver_manager,
pysp.plugins.phpyro.SolverManager_PHPyro):
ph._solver_manager.release_servers(shutdown=ph._shutdown_pyro_workers)
elif isinstance(ph._solver_manager,
pyomo.solvers.plugins.smanager.pyro.SolverManager_Pyro):
pysp.pyro.smanager_pyro.SolverManager_Pyro):
if ph._shutdown_pyro_workers:
ph._solver_manager.shutdown_workers()

Expand All @@ -998,7 +998,7 @@ def PHCleanup(ph):
def run_ph(options, ph):

import pyomo.environ
import pyomo.solvers.plugins.smanager.pyro
import pysp.pyro.smanager_pyro
import pysp.plugins.phpyro

start_time = time.time()
Expand Down
6 changes: 3 additions & 3 deletions pysp/solvers/ef.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
ScenarioTreeManagerClientPyro
from pysp.scenariotree.manager_solver import \
ScenarioTreeManagerSolverClientPyro
import pysp.pyro.smanager_pyro

logger = logging.getLogger('pysp')

Expand Down Expand Up @@ -175,15 +176,14 @@ def close(self):
self.destroy_ef()
if self._solver_manager is not None:
if isinstance(self._solver_manager,
pyomo.solvers.plugins.smanager.\
pyro.SolverManager_Pyro):
pysp.pyro.smanager_pyro.SolverManager_Pyro):
if self.get_option("pyro_shutdown_workers"):
self._solver_manager.shutdown_workers()
self._solver_manager = None
self._manager = None

def __init__(self, manager, *args, **kwds):
import pyomo.solvers.plugins.smanager.pyro
import pysp.pyro.smanager_pyro
super(ExtensiveFormAlgorithm, self).__init__(*args, **kwds)

# TODO: after PH moves over to the new code
Expand Down

0 comments on commit 4443fbf

Please # to comment.