Skip to content

Commit

Permalink
Merge pull request #8866 from bashtage/doc-admonitions
Browse files Browse the repository at this point in the history
DOC: Add admonitions for changes and deprecations
  • Loading branch information
bashtage committed May 5, 2023
2 parents 51dc185 + edcaf3a commit 6909efd
Show file tree
Hide file tree
Showing 12 changed files with 170 additions and 33 deletions.
14 changes: 13 additions & 1 deletion docs/source/_static/stylesheets/deprecation.css
Expand Up @@ -23,7 +23,7 @@ div.deprecated, div.versionadded, div.versionchanged {
position: relative;
transition: color .25s,background-color .25s,border-color .25s;
vertical-align: middle;
font-size: 0.64rem;
font-size: 0.72rem;
}
div.deprecated>p, div.versionadded>p, div.versionchanged>p {
margin-bottom: .6rem;
Expand All @@ -35,6 +35,11 @@ div.deprecated {
background-color: rgba(255, 0, 0, 0.1);
}

div.versionadded {
border-color: #459db9;
background-color: rgba(0, 191, 255, 0.1);
}

span.versionmodified {
font-weight: 600;
}
Expand All @@ -47,7 +52,14 @@ div.deprecated p:before {
background-color: #dc3545;
}

div.versionadded p:before {
background-color: #459db9;
}

span.versionmodified.deprecated:before {
color: #dc3545;
}

span.versionmodified.added {
color: #459db9;
}
2 changes: 1 addition & 1 deletion docs/source/release/index.rst
Expand Up @@ -7,7 +7,7 @@ Release Notes
.. toctree::
:maxdepth: 1

version0.14
version0.14.0
version0.13.4-5
version0.13.3
version0.13.2
Expand Down
Expand Up @@ -21,11 +21,11 @@ was already in statsmodels main and how much usage it has already
seen. If there are specific known problems or limitations, then they
are mentioned in the docstrings.

Github Stats
------------
**Issues Closed**: 248
Stats
-----
**Issues Closed**: 255

**Pull Requests Merged**: 335
**Pull Requests Merged**: 345


The Highlights
Expand All @@ -44,14 +44,14 @@ selection or treatment model, outcome model and effect functions.

Hurdle and Truncated Count Regression
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:class:`statsmodels.discrete.truncated_model.HurdleModel` implements
:class:`statsmodels.discrete.truncated_model.HurdleCountModel` implements
hurdle models for count data with either Poisson or NegativeBinomialP as
submodels.
Three left truncated models used for zero truncation are available,
:class:`statsmodels.discrete.truncated_model.TruncatedLFPoisson`,
:class:`statsmodels.discrete.truncated_model.TruncatedLFNegativeBinomialP`
and
:class:`statsmodels.discrete.truncated_model.TruncatedLFGeneralized Poisson`.
:class:`statsmodels.discrete.truncated_model.TruncatedLFGeneralizedPoisson`.
Models for right censoring at one are implemented but only as support for
the hurdle models.

Expand Down Expand Up @@ -108,7 +108,7 @@ Other Notable Enhancments
-------------------------

- burg option in pacf :pr:`8113`
- new link for GLM: logc :pr:`8155`
- new link for GLM: Logc :pr:`8155`
- rename class names for links for GLM, lower case names are deprecated :pr:`8569`
- allow singular covariance in gaussian copula :pr:`8504`
- GLM: Tweedie full loglikelihood :pr:`8560`
Expand Down Expand Up @@ -144,7 +144,7 @@ Submodules
- Fix a typo in the documentation (:pr:`8275`)
- Fix `histogram` (:pr:`8299`)
- Add notebook for Poisson post-estimation overview (:pr:`8420`)

- Add version (:pr:`8863`)



Expand Down Expand Up @@ -186,6 +186,7 @@ Submodules
- MNLogit if endog is series with no name (:pr:`8674`)
- Get_distribution, return 1-d instead of column frozen distribution (:pr:`8780`)
- Numpy compat, indexed assignment shape in NegativeBinomial (:pr:`8822`)
- Support offset in truncated count models (:pr:`8845`)



Expand Down Expand Up @@ -245,6 +246,9 @@ Submodules
- Update PRs in release note (:pr:`8805`)
- Improve release notes highlights (:pr:`8806`)
- Fix more deprecations and restore doc build (:pr:`8826`)
- Final changes for 0.14.0rc0 notes (:pr:`8839`)
- Fix internet address of dataset (:pr:`8861`)
- Small additional fixes (:pr:`8862`)



Expand Down Expand Up @@ -616,7 +620,7 @@ Thanks to all of the contributors for the 0.14.0 release (based on git log):
- Eva Maxfield Brown
- Evgeny Zhurko
- Ewout Ter Hoeven
- Geoffrey M. Oxberry
- Geoffrey Oxberry
- Greg Mcmahan
- Gregory Parkes
- Guilherme Silveira
Expand All @@ -629,6 +633,7 @@ Thanks to all of the contributors for the 0.14.0 release (based on git log):
- Josef Perktold
- João Tanaka
- Kees Mulder
- Kerby Shedden
- Kevin Sheppard
- Kirill Milash
- Kirill Ulanov
Expand Down Expand Up @@ -1019,3 +1024,14 @@ The following Pull Requests were merged since the last release:
- :pr:`8831`: BUG: Correct initial level, treand and seasonal
- :pr:`8834`: MAINT: Switch DeprecationWarn to FutureWarn
- :pr:`8835`: ENH: Add sharex for seasonal decompose plots
- :pr:`8839`: DOC: Final changes for 0.14.0rc0 notes
- :pr:`8845`: BUG/ENH: support offset in truncated count models
- :pr:`8847`: DOC: Use JSON for versioning
- :pr:`8851`: BUG: Fix added variable plots to work with OLS
- :pr:`8857`: DOC: Small fix for STLForecast example
- :pr:`8858`: DOC: Fix example notebooks
- :pr:`8861`: DOC: Fix internet address of dataset
- :pr:`8862`: DOC: Small additional fixes
- :pr:`8863`: DOC: Add version
- :pr:`8865`: MAINT: Move from Styler.applymap to map
- :pr:`8866`: DOC: Add admonitions for changes and deprecations
54 changes: 49 additions & 5 deletions statsmodels/discrete/discrete_model.py
Expand Up @@ -506,6 +506,11 @@ def predict(self, params, exog=None, which="mean", linear=None,
- 'var' returns the estimated variance of endog implied by the
model.
.. versionadded: 0.14
``which`` replaces and extends the deprecated ``linear``
argument.
linear : bool
If True, returns the linear predicted values. If False or None,
then the statistic specified by ``which`` will be returned.
Expand Down Expand Up @@ -741,9 +746,28 @@ def predict(self, params, exog=None, which="mean", linear=None):
it assumed to be 1 row of exogenous variables. If you only have
one regressor and would like to do prediction, you must provide
a 2d array with shape[1] == 1.
linear : bool, optional
If True, returns the linear predictor dot(exog,params). Else,
returns the value of the cdf at the linear predictor.
which : {'mean', 'linear', 'var', 'prob'}, optional
Statistic to predict. Default is 'mean'.
- 'mean' returns the conditional expectation of endog E(y | x),
i.e. exp of linear predictor.
- 'linear' returns the linear predictor of the mean function.
- 'var' returns the estimated variance of endog implied by the
model.
.. versionadded: 0.14
``which`` replaces and extends the deprecated ``linear``
argument.
linear : bool
If True, returns the linear predicted values. If False or None,
then the statistic specified by ``which`` will be returned.
.. deprecated: 0.14
The ``linear` keyword is deprecated and will be removed,
use ``which`` keyword instead.
Notes
-----
Expand Down Expand Up @@ -999,12 +1023,21 @@ def predict(self, params, exog=None, exposure=None, offset=None,
- 'var' variance of endog implied by the likelihood model
- 'prob' predicted probabilities for counts.
.. versionadded: 0.14
``which`` replaces and extends the deprecated ``linear``
argument.
linear : bool
The ``linear` keyword is deprecated and will be removed,
use ``which`` keyword instead.
If True, returns the linear predicted values. If False or None,
then the statistic specified by ``which`` will be returned.
.. deprecated: 0.14
The ``linear` keyword is deprecated and will be removed,
use ``which`` keyword instead.
Notes
-----
If exposure is specified, then it will be logged by the method.
Expand Down Expand Up @@ -1621,11 +1654,22 @@ def predict(self, params, exog=None, exposure=None, offset=None,
- 'prob' return probabilities for counts from 0 to max(endog) or
for y_values if those are provided.
.. versionadded: 0.14
``which`` replaces and extends the deprecated ``linear``
argument.
linear : bool
The ``linear` keyword is deprecated and will be removed,
use ``which`` keyword instead.
If True, returns the linear predicted values. If False or None,
then the statistic specified by ``which`` will be returned.
.. deprecated: 0.14
The ``linear` keyword is deprecated and will be removed,
use ``which`` keyword instead.
y_values : array_like
Values of the random variable endog at which pmf is evaluated.
Only used if ``which="prob"``
Expand Down
10 changes: 10 additions & 0 deletions statsmodels/discrete/truncated_model.py
Expand Up @@ -32,6 +32,8 @@ class TruncatedLFGeneric(CountModel):
__doc__ = """
Generic Truncated model for count data
.. versionadded:: 0.14.0
%(params)s
%(extra_params)s
Expand Down Expand Up @@ -433,6 +435,8 @@ class TruncatedLFPoisson(TruncatedLFGeneric):
__doc__ = """
Truncated Poisson model for count data
.. versionadded:: 0.14.0
%(params)s
%(extra_params)s
Expand Down Expand Up @@ -504,6 +508,8 @@ class TruncatedLFNegativeBinomialP(TruncatedLFGeneric):
__doc__ = """
Truncated Generalized Negative Binomial model for count data
.. versionadded:: 0.14.0
%(params)s
%(extra_params)s
Expand Down Expand Up @@ -588,6 +594,8 @@ class TruncatedLFGeneralizedPoisson(TruncatedLFGeneric):
__doc__ = """
Truncated Generalized Poisson model for count data
.. versionadded:: 0.14.0
%(params)s
%(extra_params)s
Expand Down Expand Up @@ -1038,6 +1046,8 @@ class HurdleCountModel(CountModel):
__doc__ = """
Hurdle model for count data
.. versionadded:: 0.14.0
%(params)s
%(extra_params)s
Expand Down
10 changes: 8 additions & 2 deletions statsmodels/stats/_diagnostic_other.py
Expand Up @@ -202,7 +202,10 @@ def dispersion_poisson(results):
Each test has two strings a descriptive name and a string for the
alternative hypothesis.
"""
msg = 'dispersion_poisson here is deprecated, use '
msg = (
'dispersion_poisson here is deprecated, use the version in '
'discrete._diagnostic_count'
)
warnings.warn(msg, FutureWarning)

from statsmodels.discrete._diagnostics_count import test_poisson_dispersion
Expand All @@ -225,7 +228,10 @@ def dispersion_poisson_generic(results, exog_new_test, exog_new_control=None,
Warning: insufficiently tested, especially for options
"""
msg = 'dispersion_poisson here is deprecated, use '
msg = (
'dispersion_poisson_generic here is deprecated, use the version in '
'discrete._diagnostic_count'
)
warnings.warn(msg, FutureWarning)

from statsmodels.discrete._diagnostics_count import (
Expand Down
8 changes: 8 additions & 0 deletions statsmodels/stats/multitest.py
Expand Up @@ -400,13 +400,21 @@ def fdrcorrection_twostage(pvals, alpha=0.05, method='bky',
maxiter=False is two-stage fdr (maxiter=1)
maxiter=True is full iteration (maxiter=-1 or maxiter=len(pvals))
.. versionadded:: 0.14
Replacement for ``iter`` with additional features.
iter : bool
``iter`` is deprecated use ``maxiter`` instead.
If iter is True, then only one iteration step is used, this is the
two-step method.
If iter is False, then iterations are stopped at convergence which
occurs in a finite number of steps (at most len(pvals) steps).
.. deprecated:: 0.14
Use ``maxiter`` instead of ``iter``.
Returns
-------
rejected : ndarray, bool
Expand Down

0 comments on commit 6909efd

Please sign in to comment.