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
38 changes: 19 additions & 19 deletions 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 Expand Up @@ -481,13 +481,13 @@ def time_shift(self, t_shift):
"""
Shifts a :class:`AnalogSignal` to start at a new time.

Parameters:
-----------
Parameters
----------
t_shift: Quantity (time)
Amount of time by which to shift the :class:`AnalogSignal`.

Returns:
--------
Returns
-------
new_sig: :class:`AnalogSignal`
New instance of a :class:`AnalogSignal` object starting at t_shift later than the
original :class:`AnalogSignal` (the original :class:`AnalogSignal` is not modified).
Expand Down Expand Up @@ -538,19 +538,19 @@ def downsample(self, downsampling_factor, **kwargs):
arguments, except for specifying the axis of resampling, which is fixed to the first axis
here.

Parameters:
-----------
downsampling_factor: integer
Parameters
----------
downsampling_factor: int
Factor used for decimation of samples. Scipy recommends to call decimate multiple times
for downsampling factors higher than 13 when using IIR downsampling (default).

Returns:
--------
Returns
-------
downsampled_signal: :class:`AnalogSignal`
New instance of a :class:`AnalogSignal` object containing the resampled data points.
The original :class:`AnalogSignal` is not modified.

Note:
Notes
-----
For resampling the signal with a fixed number of samples, see `resample` method.
"""
Expand Down Expand Up @@ -581,19 +581,19 @@ def resample(self, sample_count, **kwargs):
arguments, except for specifying the axis of resampling which is fixed to the first axis
here, and the sample positions. .

Parameters:
-----------
sample_count: integer
Parameters
----------
sample_count: int
Number of desired samples. The resulting signal starts at the same sample as the
original and is sampled regularly.

Returns:
--------
Returns
-------
resampled_signal: :class:`AnalogSignal`
New instance of a :class:`AnalogSignal` object containing the resampled data points.
The original :class:`AnalogSignal` is not modified.

Note:
Notes
-----
For reducing the number of samples to a fraction of the original, see `downsample` method
"""
Expand Down Expand Up @@ -625,8 +625,8 @@ def rectify(self, **kwargs):
This method is a wrapper of numpy.absolute() and accepts the same set of keyword
arguments.

Returns:
--------
Returns
-------
resampled_signal: :class:`AnalogSignal`
New instance of a :class:`AnalogSignal` object containing the rectified data points.
The original :class:`AnalogSignal` is not modified.
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
28 changes: 17 additions & 11 deletions neo/core/dataobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,22 @@ def _normalize_array_annotations(value, length):
Recursively check that value is either an array or list containing only "simple" types
(number, string, date/time) or is a dict of those.

Args:
:value: (np.ndarray, list or dict) value to be checked for consistency
:length: (int) required length of the array annotation

Returns:
np.ndarray The array_annotations from value in correct form

Raises:
ValueError: In case value is not accepted as array_annotation(s)

Parameters
----------
value : np.ndarray or list or dict
Value to be checked for consistency.
length : int
Required length of the array annotation.

Returns
-------
np.ndarray
The array_annotations from value in correct form

Raises
------
ValueError
In case value is not accepted as array_annotation(s)
"""

# First stage, resolve dict of annotations into single annotations
Expand Down Expand Up @@ -124,7 +130,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
8 changes: 4 additions & 4 deletions neo/core/epoch.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,13 @@ def time_shift(self, t_shift):
"""
Shifts an :class:`Epoch` by an amount of time.

Parameters:
-----------
Parameters
----------
t_shift: Quantity (time)
Amount of time by which to shift the :class:`Epoch`.

Returns:
--------
Returns
-------
epoch: :class:`Epoch`
New instance of an :class:`Epoch` object starting at t_shift later than the
original :class:`Epoch` (the original :class:`Epoch` is not modified).
Expand Down
8 changes: 4 additions & 4 deletions neo/core/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,13 @@ def time_shift(self, t_shift):
"""
Shifts an :class:`Event` by an amount of time.

Parameters:
-----------
Parameters
----------
t_shift: Quantity (time)
Amount of time by which to shift the :class:`Event`.

Returns:
--------
Returns
-------
epoch: Event
New instance of an :class:`Event` object starting at t_shift later than the
original :class:`Event` (the original :class:`Event` is not modified).
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
18 changes: 9 additions & 9 deletions neo/core/irregularlysampledsignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,14 @@ def resample(self, sample_count, **kwargs):
arguments, except for specifying the axis of resampling which is fixed to the first axis
here, and the sample positions. .

Parameters:
-----------
sample_count: integer
Parameters
----------
sample_count: int
Number of desired samples. The resulting signal starts at the same sample as the
original and is sampled regularly.

Returns:
--------
Returns
-------
resampled_signal: :class:`AnalogSignal`
New instance of a :class:`AnalogSignal` object containing the resampled data points.
The original :class:`AnalogSignal` is not modified.
Expand Down Expand Up @@ -431,13 +431,13 @@ def time_shift(self, t_shift):
"""
Shifts a :class:`IrregularlySampledSignal` to start at a new time.

Parameters:
-----------
Parameters
----------
t_shift: Quantity (time)
Amount of time by which to shift the :class:`IrregularlySampledSignal`.

Returns:
--------
Returns
-------
new_sig: :class:`SpikeTrain`
New instance of a :class:`IrregularlySampledSignal` object
starting at t_shift later than the original :class:`IrregularlySampledSignal`
Expand Down
17 changes: 7 additions & 10 deletions 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 Expand Up @@ -145,25 +145,22 @@ def time_slice(self, t_start=None, t_stop=None, reset_time=False, **kwargs):
Creates a time slice of a Segment containing slices of all child
objects.

Parameters:
-----------
Parameters
----------
t_start: Quantity
Starting time of the sliced time window.
t_stop: Quantity
Stop time of the sliced time window.
reset_time: bool
reset_time: bool, optional, default: False
If True the time stamps of all sliced objects are set to fall
in the range from t_start to t_stop.
If False, original time stamps are retained.
Default is False.

Keyword Arguments:
------------------
**kwargs
Additional keyword arguments used for initialization of the sliced
Segment object.

Returns:
--------
Returns
-------
subseg: Segment
Temporal slice of the original Segment from t_start to t_stop.
"""
Expand Down
16 changes: 8 additions & 8 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 Expand Up @@ -640,13 +640,13 @@ def time_shift(self, t_shift):
"""
Shifts a :class:`SpikeTrain` to start at a new time.

Parameters:
-----------
Parameters
----------
t_shift: Quantity (time)
Amount of time by which to shift the :class:`SpikeTrain`.

Returns:
--------
Returns
-------
spiketrain: :class:`SpikeTrain`
New instance of a :class:`SpikeTrain` object starting at t_shift later than the
original :class:`SpikeTrain` (the original :class:`SpikeTrain` is not modified).
Expand Down
Loading