From: Michael Orlitzky Date: Thu, 10 Nov 2016 21:15:30 +0000 (-0500) Subject: Use the DEBUG_FLOAT_FORMAT when printing exception details. X-Git-Tag: 0.1.0~52 X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dunshire.git;a=commitdiff_plain;h=428ef4a28dc25409df02f6af024043c21307a646 Use the DEBUG_FLOAT_FORMAT when printing exception details. --- diff --git a/dunshire/games.py b/dunshire/games.py index 437b533..ff3ec00 100644 --- a/dunshire/games.py +++ b/dunshire/games.py @@ -939,6 +939,7 @@ class SymmetricLinearGame: # Oops, CVXOPT tried to take the square root of a # negative number. Report some details about the game # rather than just the underlying CVXOPT crash. + printing.options['dformat'] = options.DEBUG_FLOAT_FORMAT raise PoorScalingException(self) else: raise error @@ -963,6 +964,7 @@ class SymmetricLinearGame: # that CVXOPT is convinced the problem is infeasible (and that # cannot happen). if soln_dict['status'] in ['primal infeasible', 'dual infeasible']: + printing.options['dformat'] = options.DEBUG_FLOAT_FORMAT raise GameUnsolvableException(self, soln_dict) # The "optimal" and "unknown" results, we actually treat the @@ -976,11 +978,13 @@ class SymmetricLinearGame: # it) because otherwise CVXOPT might return "unknown" and give # us two points in the cone that are nowhere near optimal. if abs(p1_value - p2_value) > 2*options.ABS_TOL: + printing.options['dformat'] = options.DEBUG_FLOAT_FORMAT raise GameUnsolvableException(self, soln_dict) # And we also check that the points it gave us belong to the # cone, just in case... if (p1_optimal not in self._K) or (p2_optimal not in self._K): + printing.options['dformat'] = options.DEBUG_FLOAT_FORMAT raise GameUnsolvableException(self, soln_dict) # For the game value, we could use any of: