Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when writing covariance #3

Open
jadball opened this issue Oct 28, 2019 · 4 comments
Open

Error when writing covariance #3

jadball opened this issue Oct 28, 2019 · 4 comments

Comments

@jadball
Copy link
Contributor

jadball commented Oct 28, 2019

I receive the following traceback message when running fitallb.py on one of the included test input files (inf10.inp):

Traceback (most recent call last):
  File "fitallb.py", line 16, in <module>
    gofitallb.run(options)
  File "gofitallb.py", line 121, in run
    fit.refine(far,options.killfile)
  File "fit.py", line 581, in refine
    lsqr.refine()
  File "fit.py", line 138, in refine
    write_output.write_cor(self,i)
  File "write_output.py", line 113, in write_cor
    string = string + '%8f  ' %(lsqr.mg.covariance[('%s' %entry1, '%s' %entry2)]/(n.sqrt(lsqr.mg.covariance[('%s' %entry1, '%s' %entry1)])*n.sqrt(lsqr.mg.covariance[('%s' %entry2, '%s' %entry2)]))) 
TypeError: 'NoneType' object has no attribute '__getitem__'
@jonwright
Copy link
Member

I suspect this is related to the change from pyMinuit to iminuit. With a quick check on windows using the pyMinuit from https://www.lfd.uci.edu/~gohlke/pythonlibs/ then the problem goes away. I see line 128 looks a bit suspicious, perhaps scale_errors needs to be debugged.
Can you try removing iminuit and installing pyminuit (from https://github.com/jpivarski/pyminuit) and see if the problem goes away?

@jadball
Copy link
Contributor Author

jadball commented Oct 30, 2019

Yes, this has fixed the problem - I have a seemingly complete covariance file now. Thanks for your help!

pyminuit was a pain to install though because Minuit itself is so old - I've included the steps I took below just in case anyone else runs into this:

wget http://seal.web.cern.ch/seal/minuit/releases/Minuit-1_7_9.tar.gz
tar xvf Minuit-1_7_9.tar.gz
cd Minuit-1_7_9
./configure CXXFLAGS='-std=gnu++0x'
make
cd ../
git clone https://github.com/jpivarski/pyminuit/
cd pyminuit
python setup.py install --with-minuit=../Minuit-1_7_9

Add the following to ~/.bashrc or equivalent so pyminuit can find the shared libraries for minuit:

export LD_LIBRARY_PATH="/path/to/Minuit-1_7_9/src/.libs:$LD_LIBRARY_PATH"

Then source ~/.bashrc or equivalent and test in python:

$ python
Python 2.7.13 (default, Oct  3 2017, 11:17:53) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import minuit
>>> 

@jonwright
Copy link
Member

OK - thanks - I will leave this open in the hope we will also get it to work in iMinuit soon.

@jadball
Copy link
Contributor Author

jadball commented Nov 8, 2019

Could you elaborate slightly on where scale_errors is that you mentioned earlier so that I can see whether I can get iminuit compatability working?
We might then be Python-3 compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants