Changeset 92948ab for python


Ignore:
Timestamp:
Oct 26, 2018, 9:12:00 PM (5 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:
81abf91
Parents:
0629356
Message:

[python] improve cvec doc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-cvec.c

    r0629356 r92948ab  
    2020} Py_cvec;
    2121
    22 static char Py_cvec_doc[] = "cvec object";
     22static char Py_cvec_doc[] = ""
     23"cvec(size)\n"
     24"\n"
     25"Data structure to hold spectral vectors.\n"
     26"\n"
     27"A vector holding spectral data in two vectors, :attr:`phas`\n"
     28"and :attr:`norm`. Each vector is a :class:`numpy.ndarray`\n"
     29"of shape `(length,)`, where `length = size // 2 + 1`.\n"
     30"\n"
     31"Parameters\n"
     32"----------\n"
     33"size: int\n"
     34"   Size of spectrum to create.\n"
     35"\n"
     36"Examples\n"
     37"--------\n"
     38">>> c = aubio.cvec(1024)\n"
     39">>> c\n"
     40"aubio cvec of 513 elements\n"
     41">>> c.length\n"
     42"513\n"
     43">>> c.norm.dtype, c.phas.dtype\n"
     44"(dtype('float32'), dtype('float32'))\n"
     45">>> c.norm.shape, c.phas.shape\n"
     46"((513,), (513,))\n"
     47"\n"
     48"See Also\n"
     49"--------\n"
     50"fft, pvoc\n"
     51"";
    2352
    2453
     
    183212  // TODO remove READONLY flag and define getter/setter
    184213  {"length", T_INT, offsetof (Py_cvec, length), READONLY,
    185       "length attribute"},
     214      "int: Length of `norm` and `phas` vectors."},
    186215  {NULL}                        /* Sentinel */
    187216};
     
    192221
    193222static PyGetSetDef Py_cvec_getseters[] = {
    194   {"norm", (getter)Py_cvec_get_norm, (setter)Py_cvec_set_norm, 
    195       "Numpy vector of shape (length,) containing the magnitude",
     223  {"norm", (getter)Py_cvec_get_norm, (setter)Py_cvec_set_norm,
     224      "numpy.ndarray: Vector of shape `(length,)` containing the magnitude.",
    196225      NULL},
    197   {"phas", (getter)Py_cvec_get_phas, (setter)Py_cvec_set_phas, 
    198       "Numpy vector of shape (length,) containing the phase",
     226  {"phas", (getter)Py_cvec_get_phas, (setter)Py_cvec_set_phas,
     227      "numpy.ndarray: Vector of shape `(length,)` containing the phase.",
    199228      NULL},
    200229  {NULL} /* sentinel */
Note: See TracChangeset for help on using the changeset viewer.