I am succeding fiiting a function with iminuit in python but I can't get rid of the message even with "print_level =-1" or "print_level =0".
Here is the minimalist code I use:
from iminuit import Minuit
m = Minuit(chi2, alpha=1., beta=0., print_level=-1)
it returns:
creatFitsFile.py:430: InitialParamWarning: errordef is not given. Default to 1.
m = Minuit(chi2, alpha=1., beta=0., print_level=-1)
creatFitsFile.py:430: InitialParamWarning: Parameter alpha is floating but does not have initial step size. Assume 1.
I just want it to be quiet because I fit inside a loop with ~170.000 set of data.
Thank you
Try setting pedantic=False
in the parameter list.
Example -
from iminuit import Minuit
m = Minuit(chi2, pedantic=False, alpha=1., beta=0., print_level=-1)
From the documentation -
pedantic: warns about parameters that do not have initial value or initial error/stepsize set.
From the warnings in your console, seems like it is these warnings that are getting logged, most probably setting pedantic=False
should fix it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With