baudren / montepython_public

Public repository for the Monte Python Code
MIT License
65 stars 115 forks source link

montepython info breaking when analyising JLA chain #101

Closed TiagoBsCastro closed 7 years ago

TiagoBsCastro commented 7 years ago

Hi guys,

I was trying to learn montepython and started by using the JLA likelihood. I've created a small chain and checking it with other codes it seems just fine. However, trying to use the info routines of montepython results on the following error message. Is there something I'm doing wrong or perhaps someone has a guess if some incompatibility could cause this? Many thanks!

python montepython/MontePython.py info JLA/ --want-covmat
Running Monte Python v2.2.2

--> Finding global maximum of likelihood
--> Removing burn-in
--> Scanning file JLA/2017-07-25_1000__7.txt : Removed 0 non-markovian points, 100 points of burn-in, keep 687 steps
                      2017-07-25_100__3.txt  : Removed everything: chain not converged
                      2017-07-25_1000__4.txt : Removed everything: chain not converged
                      2017-07-25_1000__1.txt : Removed everything: chain not converged
                      2017-07-25_1000__2.txt : Removed everything: chain not converged
                      2017-07-25_100__1.txt  : Removed everything: chain not converged
                      2017-07-25_100__4.txt  : Removed 0 non-markovian points, 60 points of burn-in, keep 4 steps
                      2017-07-25_100__2.txt  : Removed everything: chain not converged
                      2017-07-25_1000__8.txt : Removed 0 non-markovian points, 54 points of burn-in, keep 710 steps
                      2017-07-25_1000__5.txt : Removed 0 non-markovian points, 113 points of burn-in, keep 682 steps
                      2017-07-25_1000__3.txt : Removed everything: chain not converged
                      2017-07-25_1000__6.txt : Removed 0 non-markovian points, 112 points of burn-in, keep 692 steps
--> Computing mean values
--> Computing variance
--> Computing convergence criterium (Gelman-Rubin)
 -> R-1 is 0.014936     for  Omega_cdm
           0.192422     for  alpha
           0.019108     for  beta
           0.100233     for  M
           0.312320     for  Delta_M
           0.014960     for  Omega_m
--> Computing covariance matrix
-----------------------------------------------
 /!\ The set_color_cycle attribute was deprecated in version 1.5. Use
     set_prop_cycle instead.
 -> Computing histograms for  Omega_cdm
Traceback (most recent call last):
  File "montepython/MontePython.py", line 40, in <module>
    sys.exit(run())
  File "/home/tcastro/PythonSoftware/montepython_public/montepython/run.py", line 31, in run
    custom_command)
  File "/home/tcastro/PythonSoftware/montepython_public/montepython/run.py", line 188, in safe_initialisation
    cosmo, data, command_line, success = initialise(custom_command)
  File "/home/tcastro/PythonSoftware/montepython_public/montepython/initialise.py", line 58, in initialise
    analyze(command_line)
  File "/home/tcastro/PythonSoftware/montepython_public/montepython/analyze.py", line 129, in analyze
    compute_posterior(information_instances)
  File "/home/tcastro/PythonSoftware/montepython_public/montepython/analyze.py", line 461, in compute_posterior
    bounds = minimum_credible_intervals(info)
  File "/home/tcastro/PythonSoftware/montepython_public/montepython/analyze.py", line 791, in minimum_credible_intervals
    left_edge = np.max(histogram[0] - 0.5*(histogram[1]-histogram[0]), 0.)
  File "/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 2269, in amax
    return amax(axis=axis, out=out, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py", line 26, in _amax
    return umr_maximum(a, axis, None, out, keepdims)
TypeError: 'float' object cannot be interpreted as an index
TiagoBsCastro commented 7 years ago

The problem no longer appears in the newest version.

purba13194 commented 6 years ago

I was trying to use Monte Python with Sn likelihood data. But I still get the same error. I have checked that I have the latest release of MontePython also. Please help.