A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/scipy/scipy/issues/7168 below:

Add "Examples" to docstrings · Issue #7168 · scipy/scipy · GitHub

Many of the functions in scipy do not include examples in their docstrings. Even a simple example can be helpful for a new user, so we should try to include examples wherever possible.

A script called find_functions_missing_examples.py is now maintained in my github repository analyze-scipy-code. This script reports the names of functions that are missing the "Examples" section.

Below is the output that I get when run with the current master branch. Some of these functions have proper docstrings, so all they need is the addition of an "Examples" section containing one or more illustrative examples. Many of them, however, do not comply with the numpy docstring guidelines, and may be missing the "Parameters" and "Returns" sections. In particular, the docstrings of many of the functions in scipy.special are quite terse. Anyone who works on this task should ensure that the final docstring complies with the guidelines. See, for example, #7148, where the sections "Parameters", "Returns" and "Examples" were added to the docstring of scipy.special.gamma.

I have added the tag "good first issue" to this task, because it is usually very easy to add one or two examples to a function. (How to edit the docstring of the functions in scipy.special is not obvious, but take a look at #7148 or #7143 for examples.) The tag does not mean it will be easy to complete this task. As you can see below, there is a lot of work to be done! Anyone who wants to help should feel free to pick a function or two to work on.

The script ignores functions that have the string "is deprecated" in their docstring. The names of other functions that should be ignored can be added to the list skip. If you find such a function, add a comment about it here.

Functions missing "Examples", not including fftpack and stats.mstats (last updated 15-August-2025):

scipy version 1.17.0.dev0+git20250815.2887dcb

fft (4)
    idst
    ifht
    ihfft2
    irfft2
interpolate (2)
    make_splprep
    make_splrep
linalg.interpolative (9)
    estimate_rank
    estimate_spectral_norm
    estimate_spectral_norm_diff
    id_to_svd
    interp_decomp
    reconstruct_interp_matrix
    reconstruct_matrix_from_id
    reconstruct_skel_matrix
    svd
ndimage (5)
    generic_filter1d
    generic_gradient_magnitude
    generic_laplace
    morphological_laplace
    watershed_ift
odr (1)
    odr
optimize (5)
    excitingmixing
    fmin_ncg
    fmin_tnc
    linearmixing
    linprog_verbose_callback
signal (22)
    abcd_normalize
    besselap
    buttap
    cheb1ap
    cheb2ap
    cspline2d
    ellipap
    hilbert2
    invres
    invresz
    lfiltic
    medfilt
    qspline2d
    residue
    residuez
    sos2zpk
    sosfreqz
    ss2zpk
    symiirorder1
    symiirorder2
    vectorstrength
    zpk2ss
special (123)
    assoc_laguerre
    bdtr
    bdtrc
    bdtri
    bdtrik
    bdtrin
    bei_zeros
    beip
    beip_zeros
    ber_zeros
    berp
    c_roots
    cg_roots
    chebyc
    chebys
    chndtr
    chndtridf
    chndtrinc
    chndtrix
    ellipj
    ellipk
    ellipkinc
    ellipkm1
    entr
    eval_chebyt
    eval_chebyu
    eval_gegenbauer
    eval_genlaguerre
    eval_hermite
    eval_hermitenorm
    eval_jacobi
    eval_laguerre
    eval_sh_chebyt
    eval_sh_chebyu
    eval_sh_jacobi
    eval_sh_legendre
    fresnel_zeros
    fresnelc_zeros
    fresnels_zeros
    h_roots
    hankel1
    hankel1e
    hankel2
    hankel2e
    he_roots
    hermitenorm
    j_roots
    jnjnp_zeros
    js_roots
    kei_zeros
    keip
    keip_zeros
    kelvin
    kelvin_zeros
    ker_zeros
    kerp
    kerp_zeros
    kl_div
    l_roots
    la_roots
    lmbda
    lpmv
    lqmn
    lqn
    mathieu_a
    mathieu_b
    mathieu_even_coef
    mathieu_modcem1
    mathieu_modcem2
    mathieu_modsem1
    mathieu_modsem2
    mathieu_odd_coef
    modfresnelm
    modfresnelp
    obl_ang1
    obl_ang1_cv
    obl_cv
    obl_cv_seq
    obl_rad1
    obl_rad1_cv
    obl_rad2
    obl_rad2_cv
    pbdn_seq
    pbdv
    pbdv_seq
    pbvv
    pbvv_seq
    pbwa
    pro_ang1
    pro_ang1_cv
    pro_cv
    pro_cv_seq
    pro_rad1
    pro_rad1_cv
    pro_rad2
    pro_rad2_cv
    ps_roots
    rel_entr
    riccati_jn
    riccati_yn
    roots_chebyc
    roots_chebys
    roots_chebyt
    roots_chebyu
    roots_gegenbauer
    roots_genlaguerre
    roots_hermite
    roots_hermitenorm
    roots_jacobi
    roots_laguerre
    roots_sh_chebyt
    roots_sh_chebyu
    roots_sh_jacobi
    roots_sh_legendre
    s_roots
    sh_chebyt
    sh_chebyu
    sh_jacobi
    sh_legendre
    t_roots
    ts_roots
    u_roots
    us_roots
stats (2)
    epps_singleton_2samp
    kstatvar

Found 173 functions

(This issue was created March 13, 2017. At that time, version 0.19.0 had just been released a few days earlier. When I run this script on that version (with 'fft' removed from modules), it finds 674 functions without examples.)

Note: if your PR only adds documentation, please add [docs only] on a new line in the commit message. This will help save our CI credits.

person142, rgommers, rabernat, jotasi, twmr and 8 more


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4