Skip to content

Commit bd640f8

Browse files
authored
Merge pull request #3234 from henriquejsfj/patch-1
Fix: Get SCIP solving time considering float number with some text
2 parents 4e8e48d + 3ce7416 commit bd640f8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pyomo/solvers/plugins/solvers/SCIPAMPL.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def read_scip_log(filename: str):
455455
solver_status = scip_lines[0][colon_position + 2 : scip_lines[0].index('\n')]
456456

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

461461
try:

pyomo/solvers/tests/mip/test_scip.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ def test_scip_solve_from_instance_options(self):
106106
results.write(filename=_out, times=False, format='json')
107107
self.compare_json(_out, join(currdir, "test_scip_solve_from_instance.baseline"))
108108

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

110116
if __name__ == "__main__":
111117
deleteFiles = False

0 commit comments

Comments
 (0)