nest / nest-simulator

The NEST simulator
http://www.nest-simulator.org
GNU General Public License v2.0
542 stars 368 forks source link

PyNEST testsuite: test_quantal_stdp_synapse fails with Numpy 1.12.0 due to float index #680

Closed mschmidt87 closed 7 years ago

mschmidt87 commented 7 years ago

I recently installed the latest release of numpy, which is 1.12.0. Note that the release contained in the Ubuntu repositories is 1:1.11.1~rc1-1ubuntu1 for Ubuntu 16.10. To my understanding, numpy 1.12.0 will be contained in the repositories of Ubuntu 17.04 (see http://packages.ubuntu.com/search?keywords=python-numpy).

In this version of numpy, using float as an index for numpy arrays throws an error (instead of a warning as in the previous releases). This causes the quantal_stdp_synapse test to file with the error:

TypeError: 'float' object cannot be interpreted as an index

To solve this, I suggest to replace the float variables used as indices by int() when they are used as indices to numpy arrays. Alternatively, one could also define them as int in the first place, but the first option is already being used in the test script, so I will implement this and create a pull request.

If I understand the configuration file for travis correctly, we are using 14.04 (Trusty) for Travis. is this intentional? Don't we want to use the newest version of Ubuntu? Or at least the newest LTS version?

To use the newest version of numpy, I suggest to add numpy to the packages installed by pip rather than apt-get and specify 1.12.0 directly, just like it is done for cython.

heplesser commented 7 years ago

@mschmidt87 Thanks for reporting and fixing this!

Concerning the change of tools/versions, this is a more complicated issue and should be handled in a separate issue here. I much agree that we need to test with up-to-date tools, but we also need to test against old versions of tools. Otherwise, we risk that people running, e.g., LTS versions of Linux distributions or work on supercomputers (which tend to be rather late wrt versions), may no longer be able to run NEST because we added features that are not supported in older versions. We need to agree on a range of versions that we support and have a test for the oldest as well as cutting-edge. Could you open a separate issue for this?

mschmidt87 commented 7 years ago

Okay, sure, I certainly agree. I will open an issue with regards to this and take the travis modification out of #681 .

heplesser commented 7 years ago

Fixed by merge of #681.