Skip to content

Commit eb29943

Browse files
committed
FIX: Fixes
1 parent d52cc5a commit eb29943

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

nitime/tests/test_timeseries.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,11 @@ def test_timearray_math_functions():
925925
npt.assert_(getattr(b, f)().__class__ == ts.TimeArray)
926926
npt.assert_(getattr(b, f)().time_unit == b.time_unit)
927927
# comparison with unitless should convert to the TimeArray's units
928-
npt.assert_(getattr(b, f)() == getattr(a, f)())
928+
if f == "ptp":
929+
want = np.ptp(a) # ndarray.ptp removed in 2.0
930+
else:
931+
want = getattr(a, f)()
932+
npt.assert_(getattr(b, f)() == want)
929933

930934

931935
def test_timearray_var_prod():

nitime/timeseries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class instance, or an int64 array in the base unit of the module
152152
e_s += 'TimeArray in object, or int64 times, in %s' % base_unit
153153
raise ValueError(e_s)
154154

155-
time = np.array(data, copy=False)
155+
time = np.asarray(data)
156156
else:
157157
if isinstance(data, TimeInterface):
158158
time = data.copy()
@@ -309,7 +309,7 @@ def mean(self, *args, **kwargs):
309309
return ret
310310

311311
def ptp(self, *args, **kwargs):
312-
ret = TimeArray(np.ndarray.ptp(self, *args, **kwargs),
312+
ret = TimeArray(np.ptp(self, *args, **kwargs),
313313
time_unit=base_unit)
314314
ret.convert_unit(self.time_unit)
315315
return ret

0 commit comments

Comments
 (0)