Skip to content

Commit 6909efd

Browse files
authored
Merge pull request statsmodels#8866 from bashtage/doc-admonitions
DOC: Add admonitions for changes and deprecations
2 parents 51dc185 + edcaf3a commit 6909efd

File tree

12 files changed

+170
-33
lines changed

12 files changed

+170
-33
lines changed

docs/source/_static/stylesheets/deprecation.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ div.deprecated, div.versionadded, div.versionchanged {
2323
position: relative;
2424
transition: color .25s,background-color .25s,border-color .25s;
2525
vertical-align: middle;
26-
font-size: 0.64rem;
26+
font-size: 0.72rem;
2727
}
2828
div.deprecated>p, div.versionadded>p, div.versionchanged>p {
2929
margin-bottom: .6rem;
@@ -35,6 +35,11 @@ div.deprecated {
3535
background-color: rgba(255, 0, 0, 0.1);
3636
}
3737

38+
div.versionadded {
39+
border-color: #459db9;
40+
background-color: rgba(0, 191, 255, 0.1);
41+
}
42+
3843
span.versionmodified {
3944
font-weight: 600;
4045
}
@@ -47,7 +52,14 @@ div.deprecated p:before {
4752
background-color: #dc3545;
4853
}
4954

55+
div.versionadded p:before {
56+
background-color: #459db9;
57+
}
58+
5059
span.versionmodified.deprecated:before {
5160
color: #dc3545;
5261
}
5362

63+
span.versionmodified.added {
64+
color: #459db9;
65+
}

docs/source/release/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Release Notes
77
.. toctree::
88
:maxdepth: 1
99

10-
version0.14
10+
version0.14.0
1111
version0.13.4-5
1212
version0.13.3
1313
version0.13.2

docs/source/release/version0.14.rst renamed to docs/source/release/version0.14.0.rst

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ was already in statsmodels main and how much usage it has already
2121
seen. If there are specific known problems or limitations, then they
2222
are mentioned in the docstrings.
2323

24-
Github Stats
25-
------------
26-
**Issues Closed**: 248
24+
Stats
25+
-----
26+
**Issues Closed**: 255
2727

28-
**Pull Requests Merged**: 335
28+
**Pull Requests Merged**: 345
2929

3030

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

4545
Hurdle and Truncated Count Regression
4646
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47-
:class:`statsmodels.discrete.truncated_model.HurdleModel` implements
47+
:class:`statsmodels.discrete.truncated_model.HurdleCountModel` implements
4848
hurdle models for count data with either Poisson or NegativeBinomialP as
4949
submodels.
5050
Three left truncated models used for zero truncation are available,
5151
:class:`statsmodels.discrete.truncated_model.TruncatedLFPoisson`,
5252
:class:`statsmodels.discrete.truncated_model.TruncatedLFNegativeBinomialP`
5353
and
54-
:class:`statsmodels.discrete.truncated_model.TruncatedLFGeneralized Poisson`.
54+
:class:`statsmodels.discrete.truncated_model.TruncatedLFGeneralizedPoisson`.
5555
Models for right censoring at one are implemented but only as support for
5656
the hurdle models.
5757

@@ -108,7 +108,7 @@ Other Notable Enhancments
108108
-------------------------
109109

110110
- burg option in pacf :pr:`8113`
111-
- new link for GLM: logc :pr:`8155`
111+
- new link for GLM: Logc :pr:`8155`
112112
- rename class names for links for GLM, lower case names are deprecated :pr:`8569`
113113
- allow singular covariance in gaussian copula :pr:`8504`
114114
- GLM: Tweedie full loglikelihood :pr:`8560`
@@ -144,7 +144,7 @@ Submodules
144144
- Fix a typo in the documentation (:pr:`8275`)
145145
- Fix `histogram` (:pr:`8299`)
146146
- Add notebook for Poisson post-estimation overview (:pr:`8420`)
147-
147+
- Add version (:pr:`8863`)
148148

149149

150150

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

190191

191192

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

249253

250254

@@ -616,7 +620,7 @@ Thanks to all of the contributors for the 0.14.0 release (based on git log):
616620
- Eva Maxfield Brown
617621
- Evgeny Zhurko
618622
- Ewout Ter Hoeven
619-
- Geoffrey M. Oxberry
623+
- Geoffrey Oxberry
620624
- Greg Mcmahan
621625
- Gregory Parkes
622626
- Guilherme Silveira
@@ -629,6 +633,7 @@ Thanks to all of the contributors for the 0.14.0 release (based on git log):
629633
- Josef Perktold
630634
- João Tanaka
631635
- Kees Mulder
636+
- Kerby Shedden
632637
- Kevin Sheppard
633638
- Kirill Milash
634639
- Kirill Ulanov
@@ -1019,3 +1024,14 @@ The following Pull Requests were merged since the last release:
10191024
- :pr:`8831`: BUG: Correct initial level, treand and seasonal
10201025
- :pr:`8834`: MAINT: Switch DeprecationWarn to FutureWarn
10211026
- :pr:`8835`: ENH: Add sharex for seasonal decompose plots
1027+
- :pr:`8839`: DOC: Final changes for 0.14.0rc0 notes
1028+
- :pr:`8845`: BUG/ENH: support offset in truncated count models
1029+
- :pr:`8847`: DOC: Use JSON for versioning
1030+
- :pr:`8851`: BUG: Fix added variable plots to work with OLS
1031+
- :pr:`8857`: DOC: Small fix for STLForecast example
1032+
- :pr:`8858`: DOC: Fix example notebooks
1033+
- :pr:`8861`: DOC: Fix internet address of dataset
1034+
- :pr:`8862`: DOC: Small additional fixes
1035+
- :pr:`8863`: DOC: Add version
1036+
- :pr:`8865`: MAINT: Move from Styler.applymap to map
1037+
- :pr:`8866`: DOC: Add admonitions for changes and deprecations

statsmodels/discrete/discrete_model.py

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,11 @@ def predict(self, params, exog=None, which="mean", linear=None,
506506
- 'var' returns the estimated variance of endog implied by the
507507
model.
508508
509+
.. versionadded: 0.14
510+
511+
``which`` replaces and extends the deprecated ``linear``
512+
argument.
513+
509514
linear : bool
510515
If True, returns the linear predicted values. If False or None,
511516
then the statistic specified by ``which`` will be returned.
@@ -741,9 +746,28 @@ def predict(self, params, exog=None, which="mean", linear=None):
741746
it assumed to be 1 row of exogenous variables. If you only have
742747
one regressor and would like to do prediction, you must provide
743748
a 2d array with shape[1] == 1.
744-
linear : bool, optional
745-
If True, returns the linear predictor dot(exog,params). Else,
746-
returns the value of the cdf at the linear predictor.
749+
which : {'mean', 'linear', 'var', 'prob'}, optional
750+
Statistic to predict. Default is 'mean'.
751+
752+
- 'mean' returns the conditional expectation of endog E(y | x),
753+
i.e. exp of linear predictor.
754+
- 'linear' returns the linear predictor of the mean function.
755+
- 'var' returns the estimated variance of endog implied by the
756+
model.
757+
758+
.. versionadded: 0.14
759+
760+
``which`` replaces and extends the deprecated ``linear``
761+
argument.
762+
763+
linear : bool
764+
If True, returns the linear predicted values. If False or None,
765+
then the statistic specified by ``which`` will be returned.
766+
767+
.. deprecated: 0.14
768+
769+
The ``linear` keyword is deprecated and will be removed,
770+
use ``which`` keyword instead.
747771
748772
Notes
749773
-----
@@ -999,12 +1023,21 @@ def predict(self, params, exog=None, exposure=None, offset=None,
9991023
- 'var' variance of endog implied by the likelihood model
10001024
- 'prob' predicted probabilities for counts.
10011025
1026+
.. versionadded: 0.14
1027+
1028+
``which`` replaces and extends the deprecated ``linear``
1029+
argument.
1030+
10021031
linear : bool
1003-
The ``linear` keyword is deprecated and will be removed,
1004-
use ``which`` keyword instead.
10051032
If True, returns the linear predicted values. If False or None,
10061033
then the statistic specified by ``which`` will be returned.
10071034
1035+
.. deprecated: 0.14
1036+
1037+
The ``linear` keyword is deprecated and will be removed,
1038+
use ``which`` keyword instead.
1039+
1040+
10081041
Notes
10091042
-----
10101043
If exposure is specified, then it will be logged by the method.
@@ -1621,11 +1654,22 @@ def predict(self, params, exog=None, exposure=None, offset=None,
16211654
- 'prob' return probabilities for counts from 0 to max(endog) or
16221655
for y_values if those are provided.
16231656
1657+
.. versionadded: 0.14
1658+
1659+
``which`` replaces and extends the deprecated ``linear``
1660+
argument.
1661+
16241662
linear : bool
16251663
The ``linear` keyword is deprecated and will be removed,
16261664
use ``which`` keyword instead.
16271665
If True, returns the linear predicted values. If False or None,
16281666
then the statistic specified by ``which`` will be returned.
1667+
1668+
.. deprecated: 0.14
1669+
1670+
The ``linear` keyword is deprecated and will be removed,
1671+
use ``which`` keyword instead.
1672+
16291673
y_values : array_like
16301674
Values of the random variable endog at which pmf is evaluated.
16311675
Only used if ``which="prob"``

statsmodels/discrete/truncated_model.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class TruncatedLFGeneric(CountModel):
3232
__doc__ = """
3333
Generic Truncated model for count data
3434
35+
.. versionadded:: 0.14.0
36+
3537
%(params)s
3638
%(extra_params)s
3739
@@ -433,6 +435,8 @@ class TruncatedLFPoisson(TruncatedLFGeneric):
433435
__doc__ = """
434436
Truncated Poisson model for count data
435437
438+
.. versionadded:: 0.14.0
439+
436440
%(params)s
437441
%(extra_params)s
438442
@@ -504,6 +508,8 @@ class TruncatedLFNegativeBinomialP(TruncatedLFGeneric):
504508
__doc__ = """
505509
Truncated Generalized Negative Binomial model for count data
506510
511+
.. versionadded:: 0.14.0
512+
507513
%(params)s
508514
%(extra_params)s
509515
@@ -588,6 +594,8 @@ class TruncatedLFGeneralizedPoisson(TruncatedLFGeneric):
588594
__doc__ = """
589595
Truncated Generalized Poisson model for count data
590596
597+
.. versionadded:: 0.14.0
598+
591599
%(params)s
592600
%(extra_params)s
593601
@@ -1038,6 +1046,8 @@ class HurdleCountModel(CountModel):
10381046
__doc__ = """
10391047
Hurdle model for count data
10401048
1049+
.. versionadded:: 0.14.0
1050+
10411051
%(params)s
10421052
%(extra_params)s
10431053

statsmodels/stats/_diagnostic_other.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ def dispersion_poisson(results):
202202
Each test has two strings a descriptive name and a string for the
203203
alternative hypothesis.
204204
"""
205-
msg = 'dispersion_poisson here is deprecated, use '
205+
msg = (
206+
'dispersion_poisson here is deprecated, use the version in '
207+
'discrete._diagnostic_count'
208+
)
206209
warnings.warn(msg, FutureWarning)
207210

208211
from statsmodels.discrete._diagnostics_count import test_poisson_dispersion
@@ -225,7 +228,10 @@ def dispersion_poisson_generic(results, exog_new_test, exog_new_control=None,
225228
226229
Warning: insufficiently tested, especially for options
227230
"""
228-
msg = 'dispersion_poisson here is deprecated, use '
231+
msg = (
232+
'dispersion_poisson_generic here is deprecated, use the version in '
233+
'discrete._diagnostic_count'
234+
)
229235
warnings.warn(msg, FutureWarning)
230236

231237
from statsmodels.discrete._diagnostics_count import (

statsmodels/stats/multitest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,21 @@ def fdrcorrection_twostage(pvals, alpha=0.05, method='bky',
400400
maxiter=False is two-stage fdr (maxiter=1)
401401
maxiter=True is full iteration (maxiter=-1 or maxiter=len(pvals))
402402
403+
.. versionadded:: 0.14
404+
405+
Replacement for ``iter`` with additional features.
406+
403407
iter : bool
404408
``iter`` is deprecated use ``maxiter`` instead.
405409
If iter is True, then only one iteration step is used, this is the
406410
two-step method.
407411
If iter is False, then iterations are stopped at convergence which
408412
occurs in a finite number of steps (at most len(pvals) steps).
409413
414+
.. deprecated:: 0.14
415+
416+
Use ``maxiter`` instead of ``iter``.
417+
410418
Returns
411419
-------
412420
rejected : ndarray, bool

0 commit comments

Comments
 (0)