Skip to content

Commit e8f0a7f

Browse files
committed
Bugfix when printing results (jacmin_eval_nums can be None if early termination with error)
1 parent 5fdebab commit e8f0a7f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dfols/solver.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,12 @@ def __str__(self):
9292
if self.diagnostic_info is not None:
9393
output += "Diagnostic information available; check self.diagnostic_info\n"
9494
output += "Solution xmin was evaluation point %g\n" % self.xmin_eval_num
95-
if len(self.jacmin_eval_nums) < 100:
95+
if self.jacmin_eval_nums is not None and len(self.jacmin_eval_nums) < 100:
9696
output += "Approximate Jacobian formed using evaluation points %s\n" % str(self.jacmin_eval_nums)
97+
elif self.jacmin_eval_nums is None:
98+
output += "Approximate Jacobian not formed using problem information, disregard\n"
99+
else:
100+
output += "Not showing Jacobian evaluation points because it is too long; check self.jacmin_eval_nums\n"
97101
output += "Exit flag = %g\n" % self.flag
98102
output += "%s\n" % self.msg
99103
output += "****************************\n"

0 commit comments

Comments
 (0)