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
4 changes: 2 additions & 2 deletions neo/core/channelindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class ChannelIndex(Container):
_data_child_objects = ('AnalogSignal', 'IrregularlySampledSignal')
_single_parent_objects = ('Block',)
_necessary_attrs = (('index', np.ndarray, 1, np.dtype('i')),)
_recommended_attrs = ((('channel_names', np.ndarray, 1, np.dtype('S')),
_recommended_attrs = ((('channel_names', np.ndarray, 1, np.dtype('U')),
('channel_ids', np.ndarray, 1, np.dtype('i')),
('coordinates', pq.Quantity, 2)) +
Container._recommended_attrs)
Expand All @@ -173,7 +173,7 @@ def __init__(self, index, channel_names=None, channel_ids=None,

# Defaults
if channel_names is None:
channel_names = np.array([], dtype='S')
channel_names = np.array([], dtype='U')
if channel_ids is None:
channel_ids = np.array([], dtype='i')

Expand Down
2 changes: 1 addition & 1 deletion neo/io/basefromrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def read_block(self, block_index=0, lazy=False, signal_group_mode=None,
chidx_annotations.pop('name')
chidx_annotations = check_annotations(chidx_annotations)
# this should be done with array_annotation soon:
ch_names = all_channels[ind_abs]['name'].astype('S')
ch_names = all_channels[ind_abs]['name'].astype('U')
neo_channel_index = ChannelIndex(index=ind_within,
channel_names=ch_names,
channel_ids=all_channels[ind_abs]['id'],
Expand Down
2 changes: 1 addition & 1 deletion neo/io/brainwaredamio.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def read_block(self, lazy=False, **kargs):
chx = ChannelIndex(file_origin=self._filename,
channel_ids=np.array([1]),
index=np.array([0]),
channel_names=np.array(['Chan1'], dtype='S'))
channel_names=np.array(['Chan1'], dtype='U'))

# load objects into their containers
block.channel_indexes.append(chx)
Expand Down
2 changes: 1 addition & 1 deletion neo/io/brainwaresrcio.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ def __read_segment_list(self):
# create a channel_index for the numchannels
self._chx.index = np.arange(numchannels)
self._chx.channel_names = np.array(['Chan{}'.format(i)
for i in range(numchannels)], dtype='S')
for i in range(numchannels)], dtype='U')

# store what side of the head we are dealing with
for segment in segments:
Expand Down
6 changes: 3 additions & 3 deletions neo/test/coretest/test_channelindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setUp(self):
# channel_indexes = get_fake_value('channel_indexes', np.ndarray, seed=0,
# dim=1, dtype='i')
# channel_names = get_fake_value('channel_names', np.ndarray, seed=1,
# dim=1, dtype=np.dtype('S'))
# dim=1, dtype=np.dtype('U'))
# name = get_fake_value('name', str, seed=3, obj=ChannelIndex)
# description = get_fake_value('description', str, seed=4,
# obj='ChannelIndex')
Expand Down Expand Up @@ -148,7 +148,7 @@ def test__channelindex__init_defaults(self):
self.assertEqual(chx.name, None)
self.assertEqual(chx.file_origin, None)
self.assertEqual(chx.analogsignals, [])
assert_arrays_equal(chx.channel_names, np.array([], dtype='S'))
assert_arrays_equal(chx.channel_names, np.array([], dtype='U'))
assert_arrays_equal(chx.index, np.array([1]))

def test_channelindex__init(self):
Expand All @@ -158,7 +158,7 @@ def test_channelindex__init(self):
self.assertEqual(chx.file_origin, 'temp.dat')
self.assertEqual(chx.name, None)
self.assertEqual(chx.analogsignals, [])
assert_arrays_equal(chx.channel_names, np.array([], dtype='S'))
assert_arrays_equal(chx.channel_names, np.array([], dtype='U'))
assert_arrays_equal(chx.index, np.array([1]))

def check_creation(self, chx):
Expand Down
2 changes: 1 addition & 1 deletion neo/test/iotest/test_brainwaredamio.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def proc_dam(filename):
chx = ChannelIndex(file_origin=filename,
index=np.array([0]),
channel_ids=np.array([1]),
channel_names=np.array(['Chan1'], dtype='S'))
channel_names=np.array(['Chan1'], dtype='U'))

block.channel_indexes.append(chx)

Expand Down
2 changes: 1 addition & 1 deletion neo/test/iotest/test_brainwaref32io.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def proc_f32(filename):
block = Block(file_origin=filenameorig)
chx = ChannelIndex(file_origin=filenameorig,
index=np.array([], dtype=np.int),
channel_names=np.array([], dtype='S'))
channel_names=np.array([], dtype='U'))
unit = Unit(file_origin=filenameorig)

# load objects into their containers
Expand Down
2 changes: 1 addition & 1 deletion neo/test/iotest/test_brainwaresrcio.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def proc_src(filename):
chan_nums = np.arange(NChannels, dtype='int')
chan_names = ['Chan{}'.format(i) for i in range(NChannels)]
chx.index = chan_nums
chx.channel_names = np.array(chan_names, dtype='string_')
chx.channel_names = np.array(chan_names, dtype='U')
block.channel_indexes.append(chx)

for rep in srcfile['sets'][0, 0].flatten():
Expand Down
2 changes: 1 addition & 1 deletion neo/test/iotest/test_neuralynxio.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def test_ncs(self):
chid = anasig.channel_index.channel_ids[anasig_id]

# need to decode, unless keyerror
chname = anasig.channel_index.channel_names[anasig_id].decode('UTF-8')
chname = anasig.channel_index.channel_names[anasig_id]
chuid = (chname, chid)
filename = nio.ncs_filenames[chuid][:-3] + 'txt'
filename = filename.replace('original_data', 'plain_data')
Expand Down