diff --git a/src/csnlp/nlps/objective.py b/src/csnlp/nlps/objective.py index 6c4576e..5e0f53d 100644 --- a/src/csnlp/nlps/objective.py +++ b/src/csnlp/nlps/objective.py @@ -19,6 +19,12 @@ def _solve_and_get_stats( sol = solver(**kwargs) sol["p"] = kwargs["p"] # add to solution the parameters for which it was computed sol["stats"] = solver.func.stats() # add to solution the solver stats + # NOTE: in case of failure in retrieving the stats + # try: + # stats = solver.func.stats() + # except RuntimeError: + # stats = {"success": False} + # sol["stats"] = stats # add to solution the solver stats return sol diff --git a/src/csnlp/wrappers/__init__.py b/src/csnlp/wrappers/__init__.py index eb859af..9619505 100644 --- a/src/csnlp/wrappers/__init__.py +++ b/src/csnlp/wrappers/__init__.py @@ -3,7 +3,7 @@ Motivation ========== -The standard class :class:`csnlp.Mpc` provides a way to solve NLP problems; however, it +The standard class :class:`csnlp.Nlp` provides a way to solve NLP problems; however, it lacks many features that are useful in practice in different fields. For instance, it does not provide a way to scale the problem, in cases where the primal variables have widely different orders of magnitude and convergence is difficult to numerically @@ -12,8 +12,8 @@ the optimization problems. To address this, inspired by the approach adopted by the -`gymnasium ` package, we provide a way to wrap instances -of the basic :class:`csnlp.Mpc` class with wrapper classes that can add desired +`gymnasium `_ package, we provide a way to wrap instances +of the basic :class:`csnlp.Nlp` class with wrapper classes that can add desired features. Overview