Skip to content

Commit 2bd122b

Browse files
karpov-svhombit
authored andcommitted
More strict checking of when the iteration really succeeded
1 parent 2de4147 commit 2bd122b

File tree

1 file changed

+5
-4
lines changed
  • light-curve/light_curve/light_curve_py/features/rainbow

1 file changed

+5
-4
lines changed

light-curve/light_curve/light_curve_py/features/rainbow/_base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,17 +355,18 @@ def _eval_and_get_errors(
355355
minuit.strategy = 0 # We will need to manually call .hesse() on convergence anyway
356356

357357
# Supposedly it is not the same as just setting iterate=10?..
358-
for iter in range(10):
358+
for i in range(10):
359359
minuit.migrad()
360360

361361
if minuit.valid:
362362
minuit.hesse()
363+
# hesse() may may drive it invalid
364+
if minuit.valid:
365+
break
363366
else:
364367
# That's what iterate is supposed to do?..
365368
minuit.simplex()
366-
367-
if minuit.valid:
368-
break
369+
# FIXME: it may drive the fit valid, but we will not have Hesse run on last iteration
369370

370371
if debug:
371372
# Expose everything we have to outside, unscaled, for easier debugging

0 commit comments

Comments
 (0)