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
156156 PyObject * Py_aubio_level_detection(PyObject *self, PyObject *args);
157157
158158 static char Py_aubio_shift_doc[] = ""
159−"Swap left and right partitions of a vector\n"
159+"shift(vec)\n"
160160 "\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"
162176 "\n"
163177 "For a vector of length N, the partition is split at index N - N//2.\n"
164178 "\n"
165179 "Example\n"
166180 "-------\n"
167181 "\n"
168−">>> import numpy\n"
169−">>> shift(numpy.arange(3, dtype=aubio.float_type))\n"
170−"array([2., 0., 1.], dtype=" AUBIO_NPY_SMPL_STR ")";
182+">>> aubio.shift(aubio.fvec(np.arange(3)))\n"
183+"array([2., 0., 1.], dtype=" AUBIO_NPY_SMPL_STR ")\n"
184+"\n"
185+"See Also\n"
186+"--------\n"
187+"ishift\n"
188+"";
171189 PyObject * Py_aubio_shift(PyObject *self, PyObject *args);
172190
173191 static char Py_aubio_ishift_doc[] = ""
174−"Swap right and left partitions of a vector\n"
192+"ishift(vec)\n"
175193 "\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"
177195 "\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"
179211 "\n"
180212 "Example\n"
181213 "-------\n"
182214 "\n"
183−">>> import numpy\n"
184−">>> ishift(numpy.arange(3, dtype=aubio.float_type))\n"
185−"array([1., 2., 0.], dtype=" AUBIO_NPY_SMPL_STR ")";
215+">>> aubio.ishift(aubio.fvec(np.arange(3)))\n"
216+"array([1., 2., 0.], dtype=" AUBIO_NPY_SMPL_STR ")\n"
217+"\n"
218+"See Also\n"
219+"--------\n"
220+"shift\n"
221+"";
186222 PyObject * Py_aubio_ishift(PyObject *self, PyObject *args);
187223
188224 #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