From 1ef6b0659de65b69a358583f7c88dfc45cb2faa5 Mon Sep 17 00:00:00 2001 From: Carl Recine Date: Wed, 1 May 2024 15:16:48 -0700 Subject: [PATCH] feedback from ewu63 --- pyoptsparse/pyOpt_optimization.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyoptsparse/pyOpt_optimization.py b/pyoptsparse/pyOpt_optimization.py index 3cd373a1..15c7f67c 100644 --- a/pyoptsparse/pyOpt_optimization.py +++ b/pyoptsparse/pyOpt_optimization.py @@ -1577,12 +1577,11 @@ def _mapContoOpt_Dict(self, conDict: Dict1DType) -> Dict1DType: con_opt = self._mapContoOpt(con) return self.processContoDict(con_opt, scaled=False, natural=True) - def __str__(self): + def summary_str(self, minimal_print=False): """ Print Structured Optimization Problem """ TOL = 1.0e-6 - minimal_print = getattr(self, "minimal_print", True) text = ( f"\n\nOptimization Problem -- {self.name}\n{'=' * 80}\n Objective Function: {self.objFun.__name__}\n\n" @@ -1708,6 +1707,9 @@ def __str__(self): return text + def __str__(self, minimal_print=False): + return self.summary_str(minimal_print) + def __getstate__(self) -> dict: """ This is used for serializing class instances.