Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion neo/core/analogsignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def _pp(line):
def time_index(self, t):
"""Return the array index (or indices) corresponding to the time (or times) `t`"""
i = (t - self.t_start) * self.sampling_rate
i = np.rint(i.simplified.magnitude).astype(np.int)
i = np.rint(i.simplified.magnitude).astype(np.int64)
return i

def time_slice(self, t_start, t_stop):
Expand Down
4 changes: 2 additions & 2 deletions neo/core/spiketrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def __new__(cls, times, t_stop, units=None, dtype=None, copy=True, sampling_rate

if dtype is None:
if not hasattr(times, 'dtype'):
dtype = np.float
dtype = np.float_
elif hasattr(times, 'dtype') and times.dtype != dtype:
if not copy:
raise ValueError("cannot change dtype and return view")
Expand Down Expand Up @@ -310,7 +310,7 @@ def __new__(cls, times, t_stop, units=None, dtype=None, copy=True, sampling_rate

return obj

def __init__(self, times, t_stop, units=None, dtype=np.float, copy=True,
def __init__(self, times, t_stop, units=None, dtype=None, copy=True,
sampling_rate=1.0 * pq.Hz, t_start=0.0 * pq.s, waveforms=None, left_sweep=None,
name=None, file_origin=None, description=None, array_annotations=None,
**annotations):
Expand Down
2 changes: 1 addition & 1 deletion neo/io/alphaomegaio.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def count_samples(m_length):
list_data[ind_chan].append(ind_block)

# step 4: compute the length (number of samples) of the channels
chan_len = np.zeros(len(list_data), dtype=np.int)
chan_len = np.zeros(len(list_data), dtype=np.int64)
for ind_chan, list_blocks in enumerate(list_data):
for ind_block in list_blocks:
chan_len[ind_chan] += count_samples(
Expand Down
2 changes: 1 addition & 1 deletion neo/io/brainwaredamio.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _read_segment(self, fobject):
# int16 * numpts -- the AnalogSignal itself
signal = np.fromfile(fobject, dtype=np.int16, count=numpts)

sig = AnalogSignal(signal.astype(np.float) * pq.mV,
sig = AnalogSignal(signal.astype(np.float32) * pq.mV,
t_start=t_start * pq.d,
file_origin=self._filename,
sampling_period=1. * pq.s,
Expand Down
2 changes: 1 addition & 1 deletion neo/io/klustakwikio.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def write_block(self, block):

# Convert to samples
spike_times_in_samples = np.rint(
np.array(st) * sr).astype(np.int)
np.array(st) * sr).astype(np.int64)

# Try to get features from spiketrain
try:
Expand Down
4 changes: 2 additions & 2 deletions neo/io/tiffio.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ def natural_sort(l):
list_data_image = []
for file_name in file_name_list:
list_data_image.append(
np.array(Image.open(self.filename + "/" + file_name), dtype=np.float))
np.array(Image.open(self.filename + "/" + file_name), dtype=np.float32))
list_data_image = np.array(list_data_image)
if len(list_data_image.shape) == 4:
list_data_image = []
for file_name in file_name_list:
list_data_image.append(
np.array(Image.open(self.filename + "/" + file_name).convert('L'), dtype=np.float))
np.array(Image.open(self.filename + "/" + file_name).convert('L'), dtype=np.float32))

print("read block")
image_sequence = ImageSequence(np.stack(list_data_image),
Expand Down
4 changes: 2 additions & 2 deletions neo/test/coretest/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ def test_numpy_array_uint64(self):

def test_numpy_array_float(self):
'''test to make sure float type numpy arrays are accepted'''
value = np.array([1, 2, 3, 4, 5], dtype=np.float)
value = np.array([1, 2, 3, 4, 5], dtype=np.float_)
self.base.annotate(data=value)
result = {'data': value}
self.assertDictEqual(result, self.base.annotations)
Expand Down Expand Up @@ -1048,7 +1048,7 @@ def test_numpy_scalar_uint64(self):

def test_numpy_scalar_float(self):
'''test to make sure float type numpy scalars are accepted'''
value = np.array(99, dtype=np.float)
value = np.array(99, dtype=np.float_)
self.base.annotate(data=value)
result = {'data': value}
self.assertDictEqual(result, self.base.annotations)
Expand Down
4 changes: 2 additions & 2 deletions neo/test/coretest/test_spiketrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ def test_defaults(self):
train2 = _new_spiketrain(SpikeTrain, [3, 4, 5], units='sec', t_stop=10.0)
assert_neo_object_is_compliant(train1)
assert_neo_object_is_compliant(train2)
self.assertEqual(train1.dtype, np.float)
self.assertEqual(train2.dtype, np.float)
self.assertEqual(train1.dtype, np.float_)
self.assertEqual(train2.dtype, np.float_)
self.assertEqual(train1.sampling_rate, 1.0 * pq.Hz)
self.assertEqual(train2.sampling_rate, 1.0 * pq.Hz)
self.assertEqual(train1.waveforms, None)
Expand Down
2 changes: 1 addition & 1 deletion neo/test/iotest/test_nestio.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def test_read_float(self):
t_stop=500. * pq.ms,
lazy=False, id_column_gdf=0, time_column_gdf=1)
sts = seg.spiketrains
self.assertTrue(all([s.magnitude.dtype == np.float for s in sts]))
self.assertTrue(all([s.magnitude.dtype == np.float_ for s in sts]))

def test_values(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion neo/test/iotest/test_nixio.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ def test_signals_write(self):
IrregularlySampledSignal(times=np.sort(np.random.random(10)),
signal=np.random.random((10, 13)),
units="mV", time_units="s",
dtype=np.float,
dtype=np.float32,
name="some sort of signal",
description="the signal is described")
)
Expand Down