Loading pyehub/energy_hub/ehub_model.py +1 −1 Original line number Diff line number Diff line Loading @@ -87,13 +87,13 @@ class EHubModel: Returns: The results """ print(solver_settings) if solver_settings is None: solver_settings = DEFAULT_SOLVER_SETTINGS solver = solver_settings["name"] options = solver_settings["options"] if options is None: options = {} Loading pyehub/pylp/problem.py +4 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ def solve( minimize: bool = False, solver: str = "glpk", verbose: bool = False, options: list = None, **kwargs, ) -> Status: """ Loading @@ -39,6 +40,7 @@ def solve( minimize: True for minimizing; False for maximizing solver: The solver to use. Current supports 'glpk', 'theo-cluster' and 'cplex'. verbose: If True, output the results of the solver options list: add options to the (glpk) solver **kwargs: is used to set the cluster path Returns: Loading @@ -64,14 +66,14 @@ def solve( if solver == "glpk": try: solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=kwargs['options']) solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options) except: 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=kwargs['options']) solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options) except: print("solver_path is not set, going to default.") # This catches the error if glpk_path is not set Loading Loading
pyehub/energy_hub/ehub_model.py +1 −1 Original line number Diff line number Diff line Loading @@ -87,13 +87,13 @@ class EHubModel: Returns: The results """ print(solver_settings) if solver_settings is None: solver_settings = DEFAULT_SOLVER_SETTINGS solver = solver_settings["name"] options = solver_settings["options"] if options is None: options = {} Loading
pyehub/pylp/problem.py +4 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ def solve( minimize: bool = False, solver: str = "glpk", verbose: bool = False, options: list = None, **kwargs, ) -> Status: """ Loading @@ -39,6 +40,7 @@ def solve( minimize: True for minimizing; False for maximizing solver: The solver to use. Current supports 'glpk', 'theo-cluster' and 'cplex'. verbose: If True, output the results of the solver options list: add options to the (glpk) solver **kwargs: is used to set the cluster path Returns: Loading @@ -64,14 +66,14 @@ def solve( if solver == "glpk": try: solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=kwargs['options']) solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options) except: 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=kwargs['options']) solver = pulp.solvers.GLPK(msg=verbose, path=kwargs['solver_path'], options=options) except: print("solver_path is not set, going to default.") # This catches the error if glpk_path is not set Loading