Skip to content

Commit

Permalink
Merge pull request Pyomo#3234 from henriquejsfj/patch-1
Browse files Browse the repository at this point in the history
Fix: Get SCIP solving time considering float number with some text
  • Loading branch information
jsiirola authored Apr 19, 2024
2 parents 4e8e48d + 3ce7416 commit bd640f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyomo/solvers/plugins/solvers/SCIPAMPL.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def read_scip_log(filename: str):
solver_status = scip_lines[0][colon_position + 2 : scip_lines[0].index('\n')]

solving_time = float(
scip_lines[1][colon_position + 2 : scip_lines[1].index('\n')]
scip_lines[1][colon_position + 2 : scip_lines[1].index('\n')].split(' ')[0]
)

try:
Expand Down
6 changes: 6 additions & 0 deletions pyomo/solvers/tests/mip/test_scip.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ def test_scip_solve_from_instance_options(self):
results.write(filename=_out, times=False, format='json')
self.compare_json(_out, join(currdir, "test_scip_solve_from_instance.baseline"))

def test_scip_solve_from_instance_with_reoptimization(self):
# Test scip with re-optimization option enabled
# This case changes the Scip output results which may break the results parser
self.scip.options['reoptimization/enable'] = True
self.test_scip_solve_from_instance()


if __name__ == "__main__":
deleteFiles = False
Expand Down

0 comments on commit bd640f8

Please sign in to comment.