@@ -47,40 +47,46 @@ def _new_event(
4747
4848class Event (DataObject ):
4949 """
50- Array of events.
51-
52- *Usage*::
53-
54- >>> from neo.core import Event
55- >>> from quantities import s
56- >>> import numpy as np
57- >>>
58- >>> evt = Event(np.arange(0, 30, 10)*s,
59- ... labels=np.array(['trig0', 'trig1', 'trig2'],
60- ... dtype='U'))
61- >>>
62- >>> evt.times
63- array([ 0., 10., 20.]) * s
64- >>> evt.labels
65- array(['trig0', 'trig1', 'trig2'],
50+ Array of events which are the start times of events along with the labels
51+ of the events
52+
53+ Parameters
54+ ----------
55+ times: quantity array 1d | list
56+ The times of the events
57+ labels: numpy.ndarray 1d dtype='U' | list
58+ Names or labels for the events
59+ units: quantity units | None, default: None
60+ If times are list the units of the times
61+ If times is a quantity array this is ignored
62+ name: str | None, default: None
63+ An optional label for the dataset
64+ description: str | None, default: None
65+ An optional text descriptoin of the dataset
66+ file_orgin: str | None, default: None
67+ The filesystem path or url of the original data file
68+ array_annotations: dict | None, default: None
69+ Dict mapping strings to numpy arrays containing annotations for all data points
70+ **annotations: dict
71+ Additional user specified metadata stored in the annotations attribue
72+
73+ Examples
74+ --------
75+
76+ >>> from neo.core import Event
77+ >>> from quantities import s
78+ >>> import numpy as np
79+ >>>
80+ >>> evt = Event(np.arange(0, 30, 10)*s,
81+ ... labels=np.array(['trig0', 'trig1', 'trig2'],
82+ ... dtype='U'))
83+ >>>
84+ >>> evt.times
85+ array([ 0., 10., 20.]) * s
86+ >>> evt.labels
87+ array(['trig0', 'trig1', 'trig2'],
6688 dtype='<U5')
6789
68- *Required attributes/properties*:
69- :times: (quantity array 1D) The time of the events.
70- :labels: (numpy.array 1D dtype='U' or list) Names or labels for the events.
71-
72- *Recommended attributes/properties*:
73- :name: (str) A label for the dataset.
74- :description: (str) Text description.
75- :file_origin: (str) Filesystem path or URL of the original data file.
76-
77- *Optional attributes/properties*:
78- :array_annotations: (dict) Dict mapping strings to numpy arrays containing annotations \
79- for all data points
80-
81- Note: Any other additional arguments are assumed to be user-specific
82- metadata and stored in :attr:`annotations`.
83-
8490 """
8591
8692 _parent_objects = ("Segment" ,)
@@ -212,9 +218,24 @@ def _repr_pretty_(self, pp, cycle):
212218 def rescale (self , units , dtype = None ):
213219 """
214220 Return a copy of the :class:`Event` converted to the specified units
221+
222+ Parameters
223+ ----------
224+ units: quantity units
225+ The units to convert the Event to
226+ dtype: None
227+ Exists for backward compatiblity within quantities see Notes for more info
228+
229+ Returns
230+ -------
231+ obj: neo.core.Event
232+ A copy of the event with the specified units
233+
234+ Notes
235+ -----
215236 The `dtype` argument exists only for backward compatibility within quantities, see
216237 https://github.com/python-quantities/python-quantities/pull/204
217- :return: Copy of self with specified units
238+
218239 """
219240 # Use simpler functionality, if nothing will be changed
220241 dim = pq .quantity .validate_dimensionality (units )
@@ -235,12 +256,19 @@ def times(self):
235256
236257 def merge (self , other ):
237258 """
238- Merge the another :class:`Event` into this one.
239-
240- The :class:`Event` objects are concatenated horizontally
259+ Merge another :class:`Event` into this one.
260+
261+ Parameter
262+ ---------
263+ other: neo.core.Event
264+ The `Event` to merge into this one
265+
266+ Notes
267+ -----
268+ * The :class:`Event` objects are concatenated horizontally
241269 (column-wise), :func:`np.hstack`).
242270
243- If the attributes of the two :class:`Event` are not
271+ * If the attributes of the two :class:`Event` are not
244272 compatible, and Exception is raised.
245273 """
246274 othertimes = other .times .rescale (self .times .units )
@@ -319,10 +347,22 @@ def duplicate_with_new_data(self, times, labels, units=None):
319347
320348 def time_slice (self , t_start , t_stop ):
321349 """
322- Creates a new :class:`Event` corresponding to the time slice of
323- the original :class:`Event` between (and including) times
324- :attr:`t_start` and :attr:`t_stop`. Either parameter can also be None
325- to use infinite endpoints for the time interval.
350+ Creates a new `Event` corresponding to the time slice of the original `Event` between (and including) times
351+ `t_start` and `t_stop`.
352+
353+ Parameters
354+ ----------
355+ t_start: float | None
356+ The starting time of the time slice
357+ If None will use -np.inf for the starting time
358+ t_stop: float | None
359+ The stopping time of the time slice
360+ If None will use np.inf for the stopping time
361+
362+ Returns
363+ -------
364+ new_evt: neo.core.Event
365+ The new `Event` limited by the time points
326366 """
327367 _t_start = t_start
328368 _t_stop = t_stop
0 commit comments