From 9016ee67651299c1d67f0d28f8d53404546709f1 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Wed, 5 Jun 2024 18:53:36 +0200 Subject: Improve logging in to_conic_problem() --- sumofsquares/problems.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sumofsquares/problems.py b/sumofsquares/problems.py index 9990264..28327a1 100644 --- a/sumofsquares/problems.py +++ b/sumofsquares/problems.py @@ -409,17 +409,22 @@ class InternalSOSProblem(Problem): if verbose: logstr = "" + + logstr += " Decision variables: " + ", ".join(self.symbols) + "\n" + logstr += " Polynomial variables: " + ", ".join(self.polynomial_symbols) + "\n" + if P is not None: - logstr += f"{P.shape = }\n" + logstr += f" {P.shape = }\n" if q is not None: - logstr += f"{q.shape = }\n" + logstr += f" {q.shape = }\n" + logstr += " Cones have dimensions:\n" for ctype, d in dims.items(): if d: - logstr += f" {ctype}: {sum(d)} {tuple(d)}\n" + logstr += f" {ctype}: {sum(d)} = sum{tuple(d)}\n" - print("Conic problem has shapes: \n", logstr) + print("Conic problem: \n" + logstr) return ConicProblem(P=P, q=q, constraints=constraints, dims=dims, is_qp=is_qp, -- cgit v1.2.1