Skip to content

Commit

Permalink
[DOC] in docstring, rename Example to Examples sections (#487)
Browse files Browse the repository at this point in the history
It seems that examples in a docstring section with title `Example` are
not displayed by sphinx, the name needs to be `Examples`.

This PR corrects the section header in a number of docstrings.

Mirror of sktime/sktime#7341 in `sktime`.
  • Loading branch information
fkiraly authored Nov 3, 2024
1 parent 5596404 commit 5849045
Show file tree
Hide file tree
Showing 32 changed files with 78 additions and 77 deletions.
4 changes: 2 additions & 2 deletions skpro/distributions/alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class Alpha(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions import Alpha
>>> distr = Alpha(a=[[1, 2], [3, 4]])
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class Beta(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.beta import Beta
>>> d = Beta(beta=[[1, 1], [2, 3], [4, 5]], alpha=2)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/binomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class Binomial(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.binomial import Binomial
>>> d = Binomial(n=[[10, 10], [20, 30], [40, 50]], p=0.5)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/chi_squared.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ChiSquared(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.chi_squared import ChiSquared
>>> chi = ChiSquared(dof=[[1, 2], [3, 4], [5, 6]])
"""
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/compose/_iid.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class IID(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> import pandas as pd
>>> from skpro.distributions.compose import IID
>>> from skpro.distributions.normal import Normal
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class Delta(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.delta import Delta
>>> delta = Delta(c=[[0, 1], [2, 3], [4, 5]])
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/empirical.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class Empirical(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> import pandas as pd
>>> from skpro.distributions.empirical import Empirical
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/fisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class Fisk(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.fisk import Fisk
>>> d = Fisk(beta=[[1, 1], [2, 3], [4, 5]], alpha=2)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Gamma(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.gamma import Gamma
>>> d = Gamma(beta=[[1, 1], [2, 3], [4, 5]], alpha=2)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/halfcauchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class HalfCauchy(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.halfcauchy import HalfCauchy
>>> hc = HalfCauchy(beta=1)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/halflogistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class HalfLogistic(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.halflogistic import HalfLogistic
>>> hl = HalfLogistic(beta=1)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/halfnormal.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class HalfNormal(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.halfnormal import HalfNormal
>>> hn = HalfNormal(sigma=1)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/inversegamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class InverseGamma(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.inversegamma import InverseGamma
>>> d = InverseGamma(beta=[[1, 1], [2, 3], [4, 5]], alpha=2)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/laplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class Laplace(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions import Laplace
>>> n = Laplace(mu=[[0, 1], [2, 3], [4, 5]], scale=1)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/logistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class Logistic(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.logistic import Logistic
>>> l = Logistic(mu=[[0, 1], [2, 3], [4, 5]], scale=1)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/loglaplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class LogLaplace(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.loglaplace import LogLaplace
>>> ll = LogLaplace(scale=1)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/lognormal.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class LogNormal(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.lognormal import LogNormal
>>> n = LogNormal(mu=[[0, 1], [2, 3], [4, 5]], sigma=1)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/meanscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class MeanScale(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.normal import Normal
>>> n = Normal(mu=[[0, 1], [2, 3], [4, 5]], sigma=2)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Mixture(BaseMetaObject, BaseDistribution):
index : pd.Index, optional, default = inferred from component distributions
columns : pd.Index, optional, default = inferred from component distributions
Example
-------
Examples
--------
>>> from skpro.distributions.mixture import Mixture
>>> from skpro.distributions.normal import Normal
Expand Down
8 changes: 4 additions & 4 deletions skpro/distributions/normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Normal(BaseDistribution):
The normal distribution is parametrized by mean :math:`\mu` and
standard deviation :math:`\sigma`, such that the pdf is
.. math:: f(x) = \frac{1}{\sigma \sqrt{2\pi}} \exp\left(-\frac{(x - \mu)^2}{2\sigma^2}\right) # noqa E501
.. math:: f(x) = \frac{1}{\sigma \sqrt{2\pi}} \exp\left(-\frac{(x - \mu)^2}{2\sigma^2}\right)
The mean :math:`\mu` is represented by the parameter ``mu``,
and the standard deviation :math:`\sigma` by the parameter ``sigma``.
Expand All @@ -33,12 +33,12 @@ class Normal(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.normal import Normal
>>> n = Normal(mu=[[0, 1], [2, 3], [4, 5]], sigma=1)
"""
""" # noqa E501

_tags = {
"capabilities:approx": ["pdfnorm"],
Expand Down
7 changes: 4 additions & 3 deletions skpro/distributions/pareto.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Pareto(BaseDistribution):
and the Pareto index (or shape parameter) :math:`\alpha`
by the parameter ``alpha``.
The CDF can be represented as,
The CDF can be represented as
:math:`F(x) = 1-\left(\frac{\text{scale}}{x}\right)^\alpha
\text{ if } x>0, 0 \text{ if } x<0`
Expand All @@ -29,8 +30,8 @@ class Pareto(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.pareto import Pareto
>>> n = Pareto(scale=[[1, 1.5], [2, 2.5], [3, 4]], alpha=3)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Poisson(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions import Poisson
>>> distr = Poisson(mu=[[1, 1], [2, 3], [4, 5]])
Expand Down
16 changes: 8 additions & 8 deletions skpro/distributions/qpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class QPD_Johnson(_DelegatedDistribution):
base_dist: str, one of ``'normal'`` (default), ``'logistic'``
options are ``'normal'`` (default) or ``'logistic'``
Example
-------
Examples
--------
>>> from skpro.distributions.qpd import QPD_Johnson # doctest: +SKIP
>>> qpd = QPD_Johnson(
Expand Down Expand Up @@ -193,8 +193,8 @@ class QPD_S(BaseDistribution):
base_dist: str, one of ``'normal'`` (default), ``'logistic'``
options are ``'normal'`` (default) or ``'logistic'``
Example
-------
Examples
--------
>>> from skpro.distributions.qpd import QPD_S # doctest: +SKIP
>>> qpd = QPD_S(
Expand Down Expand Up @@ -371,8 +371,8 @@ class QPD_B(BaseDistribution):
base_dist: str, one of ``'normal'`` (default), ``'logistic'``
options are ``'normal'`` (default) or ``'logistic'``
Example
-------
Examples
--------
>>> from skpro.distributions.qpd import QPD_B # doctest: +SKIP
>>> qpd = QPD_B(
Expand Down Expand Up @@ -555,8 +555,8 @@ class QPD_U(BaseDistribution):
base_dist: str, one of ``'normal'`` (default), ``'logistic'``
options are ``'normal'`` (default) or ``'logistic'``
Example
-------
Examples
--------
>>> from skpro.distributions.qpd import QPD_U # doctest: +SKIP
>>> qpd = QPD_U(
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/qpd_empirical.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class QPD_Empirical(Empirical):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> import pandas as pd
>>> from skpro.distributions import QPD_Empirical
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/t.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class TDistribution(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.t import TDistribution
>>> n = TDistribution(mu=[[0, 1], [2, 3], [4, 5]], sigma=1, df=10)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/truncated_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class TruncatedNormal(_ScipyAdapter):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.truncated_normal import TruncatedNormal
>>> d = TruncatedNormal(\
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/uniform.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class Uniform(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions import Uniform
>>> u = Uniform(lower=0, upper=5)
Expand Down
4 changes: 2 additions & 2 deletions skpro/distributions/weibull.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class Weibull(BaseDistribution):
index : pd.Index, optional, default = RangeIndex
columns : pd.Index, optional, default = RangeIndex
Example
-------
Examples
--------
>>> from skpro.distributions.weibull import Weibull
>>> w = Weibull(scale=[[1, 1], [2, 3], [4, 5]], k=1)
Expand Down
4 changes: 2 additions & 2 deletions skpro/regression/cyclic_boosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class CyclicBoosting(BaseProbaRegressor):
qpd: skpro.distributions.J_QPD_S
Johnson Quantile-Parameterized Distributions instance
Example
-------
Examples
--------
>>> from skpro.regression.cyclic_boosting import CyclicBoosting
>>> from sklearn.datasets import load_diabetes # doctest: +SKIP
>>> from sklearn.model_selection import train_test_split # doctest: +SKIP
Expand Down
4 changes: 2 additions & 2 deletions skpro/regression/mapie.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ class MapieRegressor(BaseProbaRegressor):
conformity_scores_: ArrayLike of shape (n_samples_train,)
Conformity scores between ``y_train`` and ``y_pred``.
Example
-------
Examples
--------
>>> from skpro.regression.mapie import MapieRegressor # doctest: +SKIP
>>> from sklearn.ensemble import RandomForestRegressor # doctest: +SKIP
>>> from sklearn.datasets import load_diabetes # doctest: +SKIP
Expand Down
4 changes: 2 additions & 2 deletions skpro/regression/residual.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ class ResidualDouble(BaseProbaRegressor):
estimator_resid_ : sklearn regressor, clone of ``estimator_resid``
fitted estimator predicting the scale of the residual
Example
-------
Examples
--------
>>> from skpro.regression.residual import ResidualDouble
>>> from sklearn.ensemble import RandomForestRegressor
>>> from sklearn.linear_model import LinearRegression
Expand Down
Loading

0 comments on commit 5849045

Please sign in to comment.