Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"print_level =-1" doesn't remove all messages

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

like image 680
londumas Avatar asked Jul 03 '15 18:07

londumas


1 Answers

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.

like image 132
Anand S Kumar Avatar answered Oct 19 '22 22:10

Anand S Kumar