Backport CI fixes to 0.7.x maintenance branch by jpgill86 · Pull Request #683 · NeuralEnsemble/python-neo · GitHub
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
20 changes: 10 additions & 10 deletions .circleci/config.yml
2 changes: 1 addition & 1 deletion neo/core/basesignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def merge(self, other):
raise MergeError("Cannot merge a lazy object with a real object.")
if other.units != self.units:
other = other.rescale(self.units)
stack = np.hstack(map(np.array, (self, other)))
stack = np.hstack((self.magnitude, other.magnitude))
kwargs = {}
for name in ("name", "description", "file_origin"):
attr_self = getattr(self, name)
Expand Down
2 changes: 1 addition & 1 deletion neo/core/irregularlysampledsignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def merge(self, other):
raise MergeError("Cannot merge a lazy object with a real object.")
if other.units != self.units:
other = other.rescale(self.units)
stack = np.hstack(map(np.array, (self, other)))
stack = np.hstack((self.magnitude, other.magnitude))
kwargs = {}
for name in ("name", "description", "file_origin"):
attr_self = getattr(self, name)
Expand Down
4 changes: 2 additions & 2 deletions neo/io/klustakwikio.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def _load_spike_times(self, fetfilename):
names = ['fet%d' % n for n in range(nbFeatures)]
names.append('spike_time')

# Load into recarray
data = mlab.csv2rec(f, names=names, skiprows=1, delimiter=' ')
# Load into recarray
data = np.recfromtxt(fetfilename, names=names, skip_header=1, delimiter=' ')

# get features
features = np.array([data['fet%d' % n] for n in range(nbFeatures)])
Expand Down
14 changes: 8 additions & 6 deletions neo/test/generate_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def generate_one_simple_segment(seg_name='segment 0', supported_objects=[], nb_a

epoch_types={'animal state': ['Sleep', 'Freeze', 'Escape'],
'light': ['dark', 'lighted']},
epoch_duration_range=[.5, 3.],
epoch_duration_range=[.5, 3.],
# this should be multiplied by pq.s, no?

array_annotations={'valid': np.array([True, False]),
'number': np.array(range(5))}
Expand Down Expand Up @@ -107,7 +108,7 @@ def generate_one_simple_segment(seg_name='segment 0', supported_objects=[], nb_a
durations = []
while t < duration:
times.append(t)
dur = rand() * np.diff(epoch_duration_range)
dur = rand() * (epoch_duration_range[1] - epoch_duration_range[0])
dur += epoch_duration_range[0]
durations.append(dur)
t = t + dur
Expand All @@ -116,8 +117,9 @@ def generate_one_simple_segment(seg_name='segment 0', supported_objects=[], nb_a
assert len(times) == len(durations)
assert len(times) == len(labels)
epc = Epoch(times=pq.Quantity(times, units=pq.s),
durations=pq.Quantity([x[0] for x in durations], units=pq.s),
labels=labels, )
durations=pq.Quantity(durations, units=pq.s),
labels=labels,)
assert epc.times.dtype == 'float'
# Randomly generate array_annotations from given options
arr_ann = {key: value[(rand(len(times)) * len(value)).astype('i')] for (key, value) in
array_annotations.items()}
Expand Down Expand Up @@ -406,8 +408,8 @@ def fake_neo(obj_type="Block", cascade=True, seed=None, n=1):
# if we are creating a block and this is the object's primary
# parent, don't create the object, we will import it from secondary
# containers later
if (cascade == 'block' and len(child._parent_objects) > 0 and obj_type !=
child._parent_objects[-1]):
if (cascade == 'block' and len(child._parent_objects) > 0
and obj_type != child._parent_objects[-1]):
continue
getattr(obj, _container_name(childname)).append(child)

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 @@ -44,7 +44,7 @@ def proc_dam(filename):
example: filename = 'file1_dam_py2.npz'
dam file name = 'file1.dam'
'''
with np.load(filename) as damobj:
with np.load(filename, allow_pickle=True) as damobj:
damfile = list(damobj.items())[0][1].flatten()

filename = os.path.basename(filename[:-12] + '.dam')
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 @@ -58,7 +58,7 @@ def proc_f32(filename):
chx.units.append(unit)

try:
with np.load(filename) as f32obj:
with np.load(filename, allow_pickle=True) as f32obj:
f32file = list(f32obj.items())[0][1].flatten()
except IOError as exc:
if 'as a pickle' in exc.message:
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 @@ -67,7 +67,7 @@ def proc_src(filename):
example: filename = 'file1_src_py2.npz'
src file name = 'file1.src'
'''
with np.load(filename) as srcobj:
with np.load(filename, allow_pickle=True) as srcobj:
srcfile = list(srcobj.items())[0][1]

filename = os.path.basename(filename[:-12] + '.src')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt