Becksteinlab / GromacsWrapper

GromacsWrapper wraps system calls to GROMACS tools into thin Python classes (GROMACS 4.6.5 - 2024 supported).
https://gromacswrapper.readthedocs.org
GNU General Public License v3.0
169 stars 53 forks source link

fix numkit float/int indexing #115

Closed orbeckst closed 7 years ago

orbeckst commented 7 years ago

The following numkit tests in test_integration.py fail

The problem is in numkit.integration.simps_error():

            if len(x.shape) == 1:
                shapex = numpy.ones(nd)
                shapex[axis] = x.shape[0]
                saveshape = x.shape
                returnshape = True
               x=x.reshape(tuple(shapex))

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

The argument for reshap (shapex) must be an integer or tuple of integers.

Fix

Probably just

                shapex = numpy.ones(nd, dtype=np.int_)

Background

dotsdl commented 7 years ago

See #114.