History

[python] improve docstrings for shift and ishift

Paul Brossier committed 8 years ago

Commit 7a7dea21 parent 0bb2d631 file · +47 −11Browse files

Showing the changes to python/ext (1 of 1 file). Show all

Unified · Split

python/ext/py-musicutils.h+47−11
@@ -156,33 +156,69 @@ static char Py_aubio_level_detection_doc[] = "" · 155 unmodified lines
156PyObject * Py_aubio_level_detection(PyObject *self, PyObject *args);156PyObject * Py_aubio_level_detection(PyObject *self, PyObject *args);
157 157
158static char Py_aubio_shift_doc[] = ""158static char Py_aubio_shift_doc[] = ""
159"Swap left and right partitions of a vector\n"159"shift(vec)\n"
160"\n"160"\n"
161"Returns the swapped vector. The input vector is also modified.\n"161"Swap left and right partitions of a vector, in-place.\n"
162"\n"
163"Parameters\n"
164"----------\n"
165"vec : fvec\n"
166" input vector to shift\n"
167"\n"
168"Returns\n"
169"-------\n"
170"fvec\n"
171" The swapped vector.\n"
172"\n"
173"Notes\n"
174"-----\n"
175"The input vector is also modified.\n"
162"\n"176"\n"
163"For a vector of length N, the partition is split at index N - N//2.\n"177"For a vector of length N, the partition is split at index N - N//2.\n"
164"\n"178"\n"
165"Example\n"179"Example\n"
166"-------\n"180"-------\n"
167"\n"181"\n"
168">>> import numpy\n"182">>> aubio.shift(aubio.fvec(np.arange(3)))\n"
169">>> shift(numpy.arange(3, dtype=aubio.float_type))\n"183"array([2., 0., 1.], dtype=" AUBIO_NPY_SMPL_STR ")\n"
170"array([2., 0., 1.], dtype=" AUBIO_NPY_SMPL_STR ")";184"\n"
185"See Also\n"
186"--------\n"
187"ishift\n"
188"";
171PyObject * Py_aubio_shift(PyObject *self, PyObject *args);189PyObject * Py_aubio_shift(PyObject *self, PyObject *args);
172 190
173static char Py_aubio_ishift_doc[] = ""191static char Py_aubio_ishift_doc[] = ""
174"Swap right and left partitions of a vector\n"192"ishift(vec)\n"
175"\n"193"\n"
176"Returns the swapped vector. The input vector is also modified.\n"194"Swap right and left partitions of a vector, in-place.\n"
177"\n"195"\n"
178"Unlike with shift(), the partition is split at index N//2.\n"196"Parameters\n"
197"----------\n"
198"vec : fvec\n"
199" input vector to shift\n"
200"\n"
201"Returns\n"
202"-------\n"
203"fvec\n"
204" The swapped vector.\n"
205"\n"
206"Notes\n"
207"-----\n"
208"The input vector is also modified.\n"
209"\n"
210"Unlike with :py:func:`shift`, the partition is split at index N//2.\n"
179"\n"211"\n"
180"Example\n"212"Example\n"
181"-------\n"213"-------\n"
182"\n"214"\n"
183">>> import numpy\n"215">>> aubio.ishift(aubio.fvec(np.arange(3)))\n"
184">>> ishift(numpy.arange(3, dtype=aubio.float_type))\n"216"array([1., 2., 0.], dtype=" AUBIO_NPY_SMPL_STR ")\n"
185"array([1., 2., 0.], dtype=" AUBIO_NPY_SMPL_STR ")";217"\n"
218"See Also\n"
219"--------\n"
220"shift\n"
221"";
186PyObject * Py_aubio_ishift(PyObject *self, PyObject *args);222PyObject * Py_aubio_ishift(PyObject *self, PyObject *args);
187 223
188#endif /* PY_AUBIO_MUSICUTILS_H */224#endif /* PY_AUBIO_MUSICUTILS_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t