Skip to content

Commit

Permalink
Apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Sep 4, 2024
1 parent 285f73f commit 616c00e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pyomo/contrib/solver/highs.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def run(self):
try:
self._solver_model.setOptionValue('log_to_console', False)
self._solver_model.setOptionValue('log_file', log_fname)

if config.threads is not None:
self._solver_model.setOptionValue('threads', config.threads)
if config.time_limit is not None:
Expand All @@ -216,7 +216,7 @@ def run(self):
self._solver_model.setOptionValue('mip_rel_gap', config.rel_gap)
if config.abs_gap is not None:
self._solver_model.setOptionValue('mip_abs_gap', config.abs_gap)

for key, option in options.items():
self._solver_model.setOptionValue(key, option)
timer.start('optimize')
Expand Down
4 changes: 1 addition & 3 deletions pyomo/contrib/solver/persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ def add_constraints(self, cons: List[ConstraintData]):
all_fixed_vars = {}
for con in cons:
if con in self._named_expressions:
raise ValueError(
f'Constraint {con.name} has already been added'
)
raise ValueError(f'Constraint {con.name} has already been added')
self._active_constraints[con] = con.expr
tmp = collect_vars_and_named_exprs(con.expr)
named_exprs, variables, fixed_vars, external_functions = tmp
Expand Down

0 comments on commit 616c00e

Please sign in to comment.