Skip to content

Commit

Permalink
code doc typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDonoghue committed Jul 26, 2022
1 parent 0aa3a68 commit 30f369c
Show file tree
Hide file tree
Showing 28 changed files with 93 additions and 93 deletions.
2 changes: 1 addition & 1 deletion neo/core/analogsignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This module implements :class:`AnalogSignal`, an array of analog signals.
:class:`AnalogSignal` inherits from :class:`basesignal.BaseSignal` which
derives from :class:`BaseNeo`, and from :class:`quantites.Quantity`which
derives from :class:`BaseNeo`, and from :class:`quantities.Quantity`which
in turn inherits from :class:`numpy.array`.
Inheritance from :class:`numpy.array` is explained here:
Expand Down
2 changes: 1 addition & 1 deletion neo/core/basesignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,4 @@ def concatenate(self, *signals):
If `other` object has incompatible attributes.
'''

NotImplementedError('Patching need to be implemented in sublcasses')
NotImplementedError('Patching need to be implemented in subclasses')
6 changes: 3 additions & 3 deletions neo/core/block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
This module defines :class:`Block`, the main container gathering all the data,
whether discrete or continous, for a given recording session. base class
whether discrete or continuous, for a given recording session. base class
used by all :module:`neo.core` classes.
:class:`Block` derives from :class:`Container`,
Expand All @@ -14,7 +14,7 @@

class Block(Container):
'''
Main container gathering all the data, whether discrete or continous, for a
Main container gathering all the data, whether discrete or continuous, for a
given recording session.
A block is not necessarily temporally homogeneous, in contrast to :class:`Segment`.
Expand Down Expand Up @@ -78,7 +78,7 @@ def __init__(self, name=None, description=None, file_origin=None,
file_datetime=None, rec_datetime=None, index=None,
**annotations):
'''
Initalize a new :class:`Block` instance.
Initialize a new :class:`Block` instance.
'''
super().__init__(name=name, description=description,
file_origin=file_origin, **annotations)
Expand Down
8 changes: 4 additions & 4 deletions neo/core/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class Container(BaseNeo):
def __init__(self, name=None, description=None, file_origin=None,
**annotations):
"""
Initalize a new :class:`Container` instance.
Initialize a new :class:`Container` instance.
"""
super().__init__(name=name, description=description,
file_origin=file_origin, **annotations)
Expand Down Expand Up @@ -466,7 +466,7 @@ def create_many_to_one_relationship(self, force=False, recursive=True):
that this method will link up.
If force is True overwrite any existing relationships
If recursive is True desecend into child objects and create
If recursive is True descend into child objects and create
relationships there
"""
parent_name = _reference_name(self.__class__.__name__)
Expand All @@ -485,7 +485,7 @@ def create_many_to_many_relationship(self, append=True, recursive=True):
of this type, put the current object in the parent list.
If append is True add it to the list, otherwise overwrite the list.
If recursive is True desecend into child objects and create
If recursive is True descend into child objects and create
relationships there
"""
parent_name = _container_name(self.__class__.__name__)
Expand Down Expand Up @@ -517,7 +517,7 @@ def create_relationship(self, force=False, append=True, recursive=True):
If force is True overwrite any existing relationships
If append is True add it to the list, otherwise overwrite the list.
If recursive is True desecend into child objects and create
If recursive is True descend into child objects and create
relationships there
"""
self.create_many_to_one_relationship(force=force, recursive=False)
Expand Down
2 changes: 1 addition & 1 deletion neo/core/dataobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _check_single_elem(element):

# Check the first element for correctness
# If its type is correct for annotations, all others are correct as well
# Note: Emtpy lists cannot reach this point
# Note: Empty lists cannot reach this point
_check_single_elem(value[0])

return value
Expand Down
2 changes: 1 addition & 1 deletion neo/core/imagesequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This module implements :class:`ImageSequence`, a 3D array.
:class:`ImageSequence` inherits from :class:`basesignal.BaseSignal` which
derives from :class:`BaseNeo`, and from :class:`quantites.Quantity`which
derives from :class:`BaseNeo`, and from :class:`quantities.Quantity`which
in turn inherits from :class:`numpy.array`.
Inheritance from :class:`numpy.array` is explained here:
Expand Down
2 changes: 1 addition & 1 deletion neo/core/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Segment(Container):
'''
A container for data sharing a common time basis.
A :class:`Segment` is a heterogeneous container for discrete or continous
A :class:`Segment` is a heterogeneous container for discrete or continuous
data sharing a common clock (time basis) but not necessary the same
sampling rate, start or end time.
Expand Down
8 changes: 4 additions & 4 deletions neo/core/spiketrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This module implements :class:`SpikeTrain`, an array of spike times.
:class:`SpikeTrain` derives from :class:`BaseNeo`, from
:module:`neo.core.baseneo`, and from :class:`quantites.Quantity`, which
:module:`neo.core.baseneo`, and from :class:`quantities.Quantity`, which
inherits from :class:`numpy.array`.
Inheritance from :class:`numpy.array` is explained here:
Expand Down Expand Up @@ -261,13 +261,13 @@ def __new__(cls, times, t_stop, units=None, dtype=None, copy=True, sampling_rate
t_start=0.0 * pq.s, waveforms=None, left_sweep=None, name=None, file_origin=None,
description=None, array_annotations=None, **annotations):
'''
Constructs a new :clas:`Spiketrain` instance from data.
Constructs a new :class:`Spiketrain` instance from data.
This is called whenever a new :class:`SpikeTrain` is created from the
constructor, but not when slicing.
'''
if len(times) != 0 and waveforms is not None and len(times) != waveforms.shape[0]:
# len(times)!=0 has been used to workaround a bug occuring during neo import
# len(times)!=0 has been used to workaround a bug occurring during neo import
raise ValueError("the number of waveforms should be equal to the number of spikes")

if dtype is not None and hasattr(times, 'dtype') and times.dtype != dtype:
Expand Down Expand Up @@ -382,7 +382,7 @@ def __array_finalize__(self, obj):
constructor, and these are set in __new__. Then they are just
copied over here.
Note that the :attr:`waveforms` attibute is not sliced here. Nor is
Note that the :attr:`waveforms` attribute is not sliced here. Nor is
:attr:`t_start` or :attr:`t_stop` modified.
'''
# This calls Quantity.__array_finalize__ which deals with
Expand Down
8 changes: 4 additions & 4 deletions neo/rawio/alphaomegarawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self, dirname="", lsx_files=None, prune_channels=True):

def _explore_folder(self):
"""
If class was instanciated with lsx_files (list of .lsx files), load only
If class was instantiated with lsx_files (list of .lsx files), load only
the files referenced in these lsx files otherwise, load all *.mpx files
in `dirname`.
It does not explores the subfolders.
Expand All @@ -114,7 +114,7 @@ def _explore_folder(self):
with open(index_file, "r") as f:
for line in f:
# a line is a Microsoft Windows path. As we cannot
# instanciate a WindowsPath on other OS than MS
# instantiate a WindowsPath on other OS than MS
# Windows, we use the PureWindowsPath class
filename = PureWindowsPath(line.strip())
filename = self.dirname / filename.name
Expand Down Expand Up @@ -145,7 +145,7 @@ def _read_file_datablocks(self, filename, prune_channels=True):
:param prune_channels: Remove references to channels and ports which
doesn't contain any data recorded. Be careful when using this option
with multiple-file data since it could theoretically leads to
expection raised when data recorded in further files are merged into
exception raised when data recorded in further files are merged into
the first file pruned from these channels.
:type prune_channels: bool
"""
Expand Down Expand Up @@ -1127,7 +1127,7 @@ def get_name(f, name_length):
- mode_spike (2 bytes): read as hex data 0xMCCC:
- M: 1=Master, 2=Slave
- CCC: linked channel
Be carefull here, the first byte cover MC and the second byte the last
Be careful here, the first byte cover MC and the second byte the last
part of the linked channel CC
"""
SDefContinAnalog = struct.Struct("<fh")
Expand Down
8 changes: 4 additions & 4 deletions neo/rawio/axographrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
data appears before the second column's. As an aside, because of this
design choice AxoGraph cannot write data to disk as it is collected but
must store it all in memory until data acquisition ends. This also affected
how file slicing was implmented for this RawIO: Instead of using a single
how file slicing was implemented for this RawIO: Instead of using a single
memmap to address into a 2-dimensional block of data, AxographRawIO
constructs multiple 1-dimensional memmaps, one for each column, each with
its own offset.
Expand Down Expand Up @@ -127,7 +127,7 @@
Segments in Neo. Certain criteria have to be met, such as all groups
containing equal numbers of traces and each group having homogeneous signal
parameters. If trace grouping was modified by the user after data
acquisition, this may result in the file being interpretted as
acquisition, this may result in the file being interpreted as
non-episodic. Older versions of the AxoGraph file format lack group headers
entirely, so these files are never deemed safe to interpret as episodic,
even if the column names follow a repeating sequence as described above.
Expand Down Expand Up @@ -397,7 +397,7 @@ def _rescale_epoch_duration(self, raw_duration, dtype, event_channel_index):

def _safe_to_treat_as_episodic(self):
"""
The purpose of this fuction is to determine if the file contains any
The purpose of this function is to determine if the file contains any
irregularities in its grouping of traces such that it cannot be treated
as episodic. Even "continuous" recordings can be treated as
single-episode recordings and could be identified as safe by this
Expand Down Expand Up @@ -627,7 +627,7 @@ def _scan_axograph_file(self):
# COLUMN TYPE

# depending on the format version, data columns may have a type
# - prior to verion 3, column types did not exist and data was
# - prior to version 3, column types did not exist and data was
# stored in a fixed pattern
# - beginning with version 3, several data types are available
# as documented in AxoGraph_ReadWrite.h
Expand Down
2 changes: 1 addition & 1 deletion neo/rawio/axonarawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop,
and three samples of 2 bytes each for 64 channels (384 bytes), which
are jumbled up in a strange order. Each channel is remapped to a
certain position (see get_channel_offset), and a channel's samples are
allcoated as follows (example for channel 7):
allocated as follows (example for channel 7):
sample 1: 32b (head) + 2*38b (remappedID) and 2*38b + 1b (2nd byte)
sample 2: 32b (head) + 128 (all chan. 1st entry) + 2*38b and ...
Expand Down
14 changes: 7 additions & 7 deletions neo/rawio/axonrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
All possible mode are possible :
- event-driven variable-length mode 1 -> return several Segments per Block
- event-driven fixed-length mode 2 or 5 -> return several Segments
- gap free mode -> return one (or sevral) Segment in the Block
- gap free mode -> return one (or several) Segment in the Block
Supported : Read
Expand Down Expand Up @@ -277,8 +277,8 @@ def _event_count(self, block_index, seg_index, event_channel_index):
return self._raw_ev_timestamps.size

def _get_event_timestamps(self, block_index, seg_index, event_channel_index, t_start, t_stop):
# In ABF timstamps are not attached too any particular segment
# so each segmetn acees all event
# In ABF timestamps are not attached too any particular segment
# so each segment accesses all events
timestamp = self._raw_ev_timestamps
labels = self._ev_labels
durations = None
Expand Down Expand Up @@ -306,7 +306,7 @@ def read_raw_protocol(self):
from the ABF1 header.
Returns: list of segments (one for every episode)
with list of analog signls (one for every DAC).
with list of analog signals (one for every DAC).
Author: JS Nowacki
"""
Expand Down Expand Up @@ -447,9 +447,9 @@ def parse_axon_soup(filename):
# hack for reading channels names and units
# this section is not very detailed and so the code
# not very robust. The idea is to remove the first
# part by find ing one of th fowoling KEY
# unfortunatly the later part contains a the file
# taht can contain by accident also one of theses keys...
# part by finding one of th following KEY
# unfortunately the later part contains a the file
# that can contain by accident also one of theses keys...
f.seek(sections['StringsSection']['uBlockIndex'] * BLOCKSIZE)
big_string = f.read(sections['StringsSection']['uBytes'])
goodstart = -1
Expand Down
6 changes: 3 additions & 3 deletions neo/rawio/baserawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
So this handles **only** one simplified but very frequent case of dataset:
* Only one channel set for AnalogSignal stable along Segment
* Only one channel set for SpikeTrain stable along Segment
* AnalogSignal have all the same sampling_rate acroos all Segment
* AnalogSignal have all the same sampling_rate across all Segment
* t_start/t_stop are the same for many object (SpikeTrain, Event) inside a Segment
Signal channels are handled by group of "stream".
Expand Down Expand Up @@ -448,7 +448,7 @@ def _check_stream_signal_channel_characteristics(self):
# also check that channel_id is unique inside a stream
channel_ids = signal_channels[mask]['id']
assert np.unique(channel_ids).size == channel_ids.size, \
f'signal_channels dont have unique ids for stream {stream_index}'
f'signal_channels do not have unique ids for stream {stream_index}'

self._several_channel_groups = signal_streams.size > 1

Expand Down Expand Up @@ -733,7 +733,7 @@ def setup_cache(self, cache_path, **init_kargs):
d = dict(ressource_name=resource_name, mtime=os.path.getmtime(resource_name))
hash = joblib.hash(d, hash_name='md5')

# name is constructed from the real_n,ame and the hash
# name is constructed from the resource_name and the hash
name = '{}_{}'.format(os.path.basename(resource_name), hash)
self.cache_filename = os.path.join(dirname, name)

Expand Down
4 changes: 2 additions & 2 deletions neo/rawio/biocamrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class BiocamRawIO(BaseRawIO):
>>> r.parse_header()
>>> print(r)
>>> raw_chunk = r.get_analogsignal_chunk(block_index=0, seg_index=0,
i_start=0, i_stop=1024,
i_start=0, i_stop=1024,
channel_names=channel_names)
>>> float_chunk = r.rescale_signal_raw_to_float(raw_chunk, dtype='float64',
channel_indexes=[0, 3, 6])
Expand Down Expand Up @@ -119,7 +119,7 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop,


def open_biocam_file_header(filename):
"""Open a Biocam hdf5 file, read and return the recording info, pick te correct method to access raw data,
"""Open a Biocam hdf5 file, read and return the recording info, pick the correct method to access raw data,
and return this to the caller."""
assert HAVE_H5PY, 'h5py is not installed'

Expand Down
18 changes: 9 additions & 9 deletions neo/rawio/blackrockrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class BlackrockRawIO(BaseRawIO):
IDs of nsX file from which to load data, e.g., if set to
5 only data from the ns5 file are loaded.
If 'all', then all nsX will be loaded.
Contrary to previsous version of the IO (<0.7), nsx_to_load
Contrary to previous version of the IO (<0.7), nsx_to_load
must be set at the init before parse_header().
Examples:
Expand Down Expand Up @@ -371,7 +371,7 @@ def _parse_header(self):
units = chan['units']
sig_dtype = 'int16'
# max_analog_val/min_analog_val/max_digital_val/min_analog_val are int16!!!!!
# dangarous situation so cast to float everyone
# dangerous situation so cast to float everyone
if np.isnan(float(chan['min_analog_val'])):
gain = 1
offset = 0
Expand All @@ -387,7 +387,7 @@ def _parse_header(self):
# check nb segment per nsx
nb_segments_for_nsx = [len(self.nsx_datas[nsx_nb]) for nsx_nb in self.nsx_to_load]
assert all(nb == nb_segments_for_nsx[0] for nb in nb_segments_for_nsx),\
'Segment nb not consistanent across nsX files'
'Segment nb not consistent across nsX files'
self._nb_segment = nb_segments_for_nsx[0]

self.__delete_empty_segments()
Expand Down Expand Up @@ -494,7 +494,7 @@ def _parse_header(self):
seg_ann['description'] = "Segment containing data from t_start to t_stop"
if seg_index == 0:
# if more than 1 segment means pause
# so datetime is valide only for seg_index=0
# so datetime is valid only for seg_index=0
seg_ann['rec_datetime'] = rec_datetime

for c in range(signal_streams.size):
Expand Down Expand Up @@ -768,7 +768,7 @@ def __read_nsx_header_variant_a(self, nsx_nb):
# basic header (file_id: NEURALCD)
dt0 = [
('file_id', 'S8'),
# label of sampling groun (e.g. "1kS/s" or "LFP Low")
# label of sampling group (e.g. "1kS/s" or "LFP Low")
('label', 'S16'),
# number of 1/30000 seconds between data points
# (e.g., if sampling rate "1 kS/s", period equals "30")
Expand Down Expand Up @@ -1119,7 +1119,7 @@ def __get_event_segment_ids(self, raw_event_data, masks, nev_data_masks):
reset_ev_ids = np.where(reset_ev_mask)[0]

# consistency check for monotone increasing time stamps
# explicitely converting to int to allow for negative diff values
# explicitly converting to int to allow for negative diff values
jump_ids = \
np.where(np.diff(np.asarray(raw_event_data['timestamp'], dtype=int)) < 0)[0] + 1
overlap = np.in1d(jump_ids, reset_ev_ids)
Expand Down Expand Up @@ -1594,7 +1594,7 @@ def __get_waveforms_dtype(self):
"""
Extracts the actual waveform dtype set for each channel.
"""
# Blackrock code giving the approiate dtype
# Blackrock code giving the appropriate dtype
conv = {0: 'int8', 1: 'int8', 2: 'int16', 4: 'int32'}

# get all electrode ids from nev ext header
Expand Down Expand Up @@ -1639,7 +1639,7 @@ def __get_channel_labels_variant_b(self):

def __get_waveform_size_variant_a(self):
"""
Returns wavform sizes for all channels for file spec 2.1 and 2.2
Returns waveform sizes for all channels for file spec 2.1 and 2.2
"""
wf_dtypes = self.__get_waveforms_dtype()
nb_bytes_wf = self.__nev_basic_header['bytes_in_data_packets'] - 8
Expand All @@ -1652,7 +1652,7 @@ def __get_waveform_size_variant_a(self):

def __get_waveform_size_variant_b(self):
"""
Returns wavform sizes for all channels for file spec 2.3
Returns waveform sizes for all channels for file spec 2.3
"""
elids = self.__nev_ext_header[b'NEUEVWAV']['electrode_id']
spike_widths = self.__nev_ext_header[b'NEUEVWAV']['spike_width']
Expand Down
Loading

0 comments on commit 30f369c

Please sign in to comment.