Skip to content

Commit b65c7e5

Browse files
committed
fix brainwaresrcio for copy behavior
1 parent bfb502d commit b65c7e5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

neo/io/brainwaresrcio.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def _assign_sequence(self, data_obj):
455455
t_stop=pq.Quantity(1, units=pq.ms, dtype=np.float32),
456456
waveforms=pq.Quantity([[[]]], dtype=np.int8, units=pq.mV),
457457
dtype=np.float32,
458-
copy=False,
458+
copy=None,
459459
timestamp=_default_datetime,
460460
respwin=np.array([], dtype=np.int32),
461461
dama_index=-1,
@@ -541,7 +541,7 @@ def _combine_spiketrains(self, spiketrains):
541541
# get the times of the spiketrains and combine them
542542
waveforms = [itrain.waveforms for itrain in spiketrains]
543543
rawtrains = np.array(np.concatenate(spiketrains, axis=1))
544-
times = pq.Quantity(rawtrains, units=pq.ms, copy=False)
544+
times = pq.Quantity(rawtrains, units=pq.ms)
545545
lens1 = np.array([wave.shape[1] for wave in waveforms])
546546
lens2 = np.array([wave.shape[2] for wave in waveforms])
547547
if lens1.max() != lens1.min() or lens2.max() != lens2.min():
@@ -564,7 +564,7 @@ def _combine_spiketrains(self, spiketrains):
564564
times = np.concatenate(times, axis=0)
565565

566566
# get the times of the SpikeTrains and combine them
567-
times = pq.Quantity(times, units=pq.ms, copy=False)
567+
times = pq.Quantity(times, units=pq.ms)
568568

569569
# get the waveforms of the SpikeTrains and combine them
570570
# these should be a 3D array with the first axis being the spike,
@@ -573,19 +573,19 @@ def _combine_spiketrains(self, spiketrains):
573573
waveforms = np.concatenate(waveforms, axis=0)
574574

575575
# extract the trig2 annotation
576-
trig2 = pq.Quantity(np.hstack(trig2), units=pq.ms, copy=False)
576+
trig2 = pq.Quantity(np.hstack(trig2), units=pq.ms)
577577

578578
if not times.size:
579579
return self._default_spiketrain.copy()
580580

581581
# get the maximum time
582582
t_stop = times[-1] * 2.0
583583

584-
waveforms = pq.Quantity(waveforms, units=pq.mV, copy=False)
584+
waveforms = pq.Quantity(waveforms, units=pq.mV)
585585

586586
train = SpikeTrain(
587587
times=times,
588-
copy=False,
588+
copy=None,
589589
t_start=self._default_t_start.copy(),
590590
t_stop=t_stop,
591591
file_origin=self._file_origin,
@@ -857,7 +857,7 @@ def __read_segment(self):
857857
trains = zip(*trains)
858858

859859
# int32 -- SpikeTrain length in ms
860-
spiketrainlen = pq.Quantity(np.fromfile(self._fsrc, dtype=np.int32, count=1)[0], units=pq.ms, copy=False)
860+
spiketrainlen = pq.Quantity(np.fromfile(self._fsrc, dtype=np.int32, count=1)[0], units=pq.ms)
861861

862862
segments = []
863863
for train in trains:
@@ -1018,7 +1018,7 @@ def __read_segment_list_var(self):
10181018
"""
10191019

10201020
# float32 -- DA conversion clock period in microsec
1021-
sampling_period = pq.Quantity(np.fromfile(self._fsrc, dtype=np.float32, count=1), units=pq.us, copy=False)[0]
1021+
sampling_period = pq.Quantity(np.fromfile(self._fsrc, dtype=np.float32, count=1), units=pq.us)[0]
10221022

10231023
# segment_collection -- this is based off a segment_collection
10241024
segments = self.__read_segment_list()
@@ -1362,7 +1362,7 @@ def __read_unit_unsorted(self):
13621362
# int32 -- SpikeTrain length in ms
13631363
# int32 * 4 -- response and spon period boundaries
13641364
parts = np.fromfile(self._fsrc, dtype=np.int32, count=5)
1365-
t_stop = pq.Quantity(parts[0].astype("float32"), units=pq.ms, copy=False)
1365+
t_stop = pq.Quantity(parts[0].astype("float32"), units=pq.ms)
13661366
respwin = parts[1:]
13671367

13681368
# (data_obj) -- list of SpikeTrains

0 commit comments

Comments
 (0)