Changeset 7a7dea2 for python


Ignore:
Timestamp:
Oct 26, 2018, 7:04:22 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
16e2bb0
Parents:
0bb2d63
Message:

[python] improve docstrings for shift and ishift

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-musicutils.h

    r0bb2d63 r7a7dea2  
    157157
    158158static char Py_aubio_shift_doc[] = ""
    159 "Swap left and right partitions of a vector\n"
    160 "\n"
    161 "Returns the swapped vector. The input vector is also modified.\n"
     159"shift(vec)\n"
     160"\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"
     
    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"";
    171189PyObject * Py_aubio_shift(PyObject *self, PyObject *args);
    172190
    173191static char Py_aubio_ishift_doc[] = ""
    174 "Swap right and left partitions of a vector\n"
    175 "\n"
    176 "Returns the swapped vector. The input vector is also modified.\n"
    177 "\n"
    178 "Unlike with shift(), the partition is split at index N//2.\n"
    179 "\n"
    180 "Example\n"
    181 "-------\n"
    182 "\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 ")";
     192"ishift(vec)\n"
     193"\n"
     194"Swap right and left partitions of a vector, in-place.\n"
     195"\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"
     211"\n"
     212"Example\n"
     213"-------\n"
     214"\n"
     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"";
    186222PyObject * Py_aubio_ishift(PyObject *self, PyObject *args);
    187223
Note: See TracChangeset for help on using the changeset viewer.