Skip to content
Closed
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
12 changes: 11 additions & 1 deletion pyomo/contrib/solver/solvers/ipopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

# Acceptable chars for the end of the alpha_pr column
# in ipopt's output, per https://coin-or.github.io/Ipopt/OUTPUT.html
_ALPHA_PR_CHARS = set("fFhHkKnNRwstTr")
_ALPHA_PR_CHARS = set("fFhHkKnNRwsStTr")


class IpoptConfig(SolverConfig):
Expand Down Expand Up @@ -613,6 +613,16 @@ def _parse_ipopt_output(self, output: Union[str, io.StringIO]) -> Dict[str, Any]

for line in iter_table:
tokens = line.strip().split()

# The ipopt output squishes the first and second columns
# if the first has a restoration flag and the second has a minus sign,
# like this: 2631r-2.9874883e+03. Catch and avoid it.
first = tokens[0]
if 'r-' in first:
it, obj = first.split('r', 1)
tokens.insert(0, it + 'r')
tokens[1] = obj

if len(tokens) != len(columns):
continue
iter_data = dict(zip(columns, tokens))
Expand Down