From 19a7bdf5e7e9a2faa0aeeea9688113965cb1f7f4 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 16 Jun 2024 19:34:15 +0200 Subject: Improve error message and comments --- sumofsquares/problems.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sumofsquares/problems.py b/sumofsquares/problems.py index 808e51c..f16eac7 100644 --- a/sumofsquares/problems.py +++ b/sumofsquares/problems.py @@ -60,7 +60,10 @@ class ConicProblem(Problem): """ Linear term of the cost function """ is_qp: bool + """ Is the problem quadratic? """ + dims: dict + """ Dimensions of the cones """ # TODO: Maybe do a dict[type, list[...]] instead? constraints: dict[str, list[tuple[tuple[NDArray, ...], NDArray]]] @@ -402,7 +405,8 @@ class InternalSOSProblem(Problem): # If this error occurs an it is not the user's fault, there is # a bug in SOSProblem.apply raise ValueError("To convert to conic constraints must be linear or affine " - f"but {str(c.expression)} has degree {constr.degree}.") + f"but {str(c.expression)} has degree {constr.degree} " + "(There is a product of decision variables).") # Get constant and linear terms constant = constr.affine_coefficient(MonomialIndex.constant()) -- cgit v1.2.1