Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Get SCIP solving time considering float number with some text #3234

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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