Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into pymc_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Meraldo Antonio committed Nov 7, 2024
2 parents 6c32481 + 5849045 commit 7844e7c
Show file tree
Hide file tree
Showing 43 changed files with 299 additions and 97 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,23 @@ concurrency:

jobs:
code-quality:
name: code-quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- id: file_changes
uses: trilom/[email protected]
with:
output: " "
- name: List changed files
run: echo '${{ steps.file_changes.outputs.files}}'
- uses: pre-commit/[email protected]
- name: repository checkout step
uses: actions/checkout@v4
- name: python environment step
uses: actions/setup-python@v5
with:
extra_args: --files ${{ steps.file_changes.outputs.files}}
- name: Check for missing init files
python-version: "3.11"
- name: install pre-commit
run: python3 -m pip install pre-commit
- id: changed-files
name: identify modified files
uses: tj-actions/changed-files@v45
- name: run pre-commit hooks on modified files
run: pre-commit run --color always --files ${{ steps.changed-files.outputs.all_changed_files }} --show-diff-on-failure
- name: check missing __init__ files
run: build_tools/fail_on_missing_init_files.sh
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ docs = [
"pydata-sphinx-theme",
"sphinx!=7.2.0,<9.0.0",
"sphinx-design<0.7.0",
"sphinx-issues<5.0.0",
"sphinx-issues<6.0.0",
"sphinx-gallery<0.19.0",
"sphinx-panels",
"tabulate",
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ addopts =
--ignore build_tools
--ignore examples
--ignore docs
--doctest-modules
--durations 10
--timeout 600
--cov skpro
Expand Down
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
16 changes: 15 additions & 1 deletion skpro/distributions/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,5 +622,19 @@ def get_test_params(cls, parameter_set="default"):
"index": pd.Index(np.arange(3)),
"columns": pd.Index(np.arange(2)),
}
params2 = {
"bins": [
[[0, 1.5, 2, 3, 4], [5, 5.5, 5.8, 6.5, 7, 7.5]],
[(2, 12, 5), [0, 1, 2, 3, 4]],
[[1.5, 2.5, 3.1, 4, 5.4], [-4, -2, -1.5, 5, 10]],
],
"bin_mass": [
[[0.1, 0.2, 0.3, 0.4], [0.25, 0.1, 0, 0.4, 0.25]],
[[0.1, 0.2, 0.4, 0.2, 0.1], [0.4, 0.3, 0.2, 0.1]],
[[0.06, 0.15, 0.09, 0.7], [0.4, 0.15, 0.325, 0.125]],
],
"index": pd.Index(np.arange(3)),
"columns": pd.Index(np.arange(2)),
}

return [params1]
return [params1, params2]
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
Loading

0 comments on commit 7844e7c

Please sign in to comment.