I had to add a safeguard for dealing with NaN / Inf values in primal/dual objectives.
A solver may returned those when an instance is primal or dual infeasible, or when an error is encountered during solving.
In such case, the primal/dual objective value in the result dictionary may be NaN, Inf or -Inf
However, JSON does not support those values. As a consequence, when reading the JSON file from disk back into memory, all such values will read as nothing.
Notes:
At present, this only seems to be an issue for ACOPF because the dual objective value is not defined (the problem is non-convex)
We might have issues when using Gurobi to solve quadratic relaxations (because it doesn't always support querying dual information), and possibly when a convex instance ends up being infeasible or unbounded (depending on what the solver would report as primal/dual objective value).
In any of the above case, the user would have access to termination status and primal/dual statuses without loss of information.
This PR
I had to add a safeguard for dealing with
NaN
/Inf
values in primal/dual objectives. A solver may returned those when an instance is primal or dual infeasible, or when an error is encountered during solving. In such case, the primal/dual objective value in the result dictionary may beNaN
,Inf
or-Inf
However, JSON does not support those values. As a consequence, when reading the JSON file from disk back into memory, all such values will read as
nothing
. Notes: