Loading pyehub/energy_hub/ehub_model.py +18 −18 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class EHubModel: if not self._compiled: self.compile() try: # try: # Use of the solver path is optional, however, # needed when doing cluster submission. solver_path = solver_settings["solver_path"] Loading @@ -112,15 +112,15 @@ class EHubModel: minimize=True, solver=solver, verbose=is_verbose, solver_path=solver_path, options=options) except: print("did not set path or options") status = pylp.solve(objective=self.objective, constraints=self.constraints, minimize=True, solver=solver, verbose=is_verbose) options=options, solver_path=solver_path,) # except: # print("did not set path or options") # status = pylp.solve(objective=self.objective, # constraints=self.constraints, # minimize=True, # solver=solver, # verbose=is_verbose) attributes = self._public_attributes() Loading pyehub/pylp/problem.py +7 −6 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ def solve( solver: str = "glpk", verbose: bool = False, options: list = None, solver_path: str = None, **kwargs, ) -> Status: """ Loading Loading @@ -65,16 +66,16 @@ def solve( problem += constraint.construct() if solver == "glpk": try: solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options) except: if solver_path==None: solver = pulp.solvers.GLPK(msg=verbose, path=solver_path, options=options) else: print("solver_path is not set, going to default, without options") # This catches the error if glpk_path is not set solver = pulp.solvers.GLPK(msg=verbose) elif solver == "glpk-cluster": try: solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options) except: if solver_path==None: solver = pulp.solvers.GLPK(msg=verbose, path=solver_path, options=options) else: print("solver_path is not set, going to default.") # This catches the error if glpk_path is not set solver = pulp.solvers.GLPK(msg=verbose, path="/home/theochri/ENV/bin/glpsol") Loading Loading
pyehub/energy_hub/ehub_model.py +18 −18 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class EHubModel: if not self._compiled: self.compile() try: # try: # Use of the solver path is optional, however, # needed when doing cluster submission. solver_path = solver_settings["solver_path"] Loading @@ -112,15 +112,15 @@ class EHubModel: minimize=True, solver=solver, verbose=is_verbose, solver_path=solver_path, options=options) except: print("did not set path or options") status = pylp.solve(objective=self.objective, constraints=self.constraints, minimize=True, solver=solver, verbose=is_verbose) options=options, solver_path=solver_path,) # except: # print("did not set path or options") # status = pylp.solve(objective=self.objective, # constraints=self.constraints, # minimize=True, # solver=solver, # verbose=is_verbose) attributes = self._public_attributes() Loading
pyehub/pylp/problem.py +7 −6 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ def solve( solver: str = "glpk", verbose: bool = False, options: list = None, solver_path: str = None, **kwargs, ) -> Status: """ Loading Loading @@ -65,16 +66,16 @@ def solve( problem += constraint.construct() if solver == "glpk": try: solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options) except: if solver_path==None: solver = pulp.solvers.GLPK(msg=verbose, path=solver_path, options=options) else: print("solver_path is not set, going to default, without options") # This catches the error if glpk_path is not set solver = pulp.solvers.GLPK(msg=verbose) elif solver == "glpk-cluster": try: solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options) except: if solver_path==None: solver = pulp.solvers.GLPK(msg=verbose, path=solver_path, options=options) else: print("solver_path is not set, going to default.") # This catches the error if glpk_path is not set solver = pulp.solvers.GLPK(msg=verbose, path="/home/theochri/ENV/bin/glpsol") Loading