TimeSeries.rms raises TypeError with numpy >= 1.11
As of numpy 1.11, slicing with non-integers raises a TypeError
, which is exactly what happens in TimeSeries.rms
:
>>> from numpy.random import random
>>> from gwpy.timeseries import TimeSeries
>>> t = TimeSeries(random(1000), dt=.25)
>>> t.rms(1.)
>>> Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy/timeseries/timeseries.py", line 1476, in rms
stepseries = self[idx:idx_end]
File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy/types/series.py", line 433, in __getitem__
new = super(Series, self).__getitem__(item)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/units/quantity.py", line 1023, in __getitem__
out = super(Quantity, self).__getitem__(key)
TypeError: slice indices must be integers or None or have an __index__ method