darrencroton / sage

Home of the Semi-Analytic Galaxy Evolution (SAGE) galaxy formation model
MIT License
21 stars 22 forks source link

allresults.py bug fix: integers for histograms #14

Closed broukema closed 4 years ago

broukema commented 5 years ago

Python 2.7.12 tolerates feeding floats to np.histogram function with a warning that the behaviour will soon be deprecated; python 2.7.13 gives a fatal error

TypeError: 'numpy.float64' object cannot be interpreted as an index

Using the floor function is not enough, because it gives float values such as 32.0 instead of integers such as 32.

This commit fixes the bug for me using python 2.7.13-2+deb9u3 (Debian GNU/Linux Stretch, which is the stable version of Debian).

darrencroton commented 4 years ago

Now fixed with a separate update.