Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

DEP: stats: Deprecate randwppf and randwcdf #3007

Merged
merged 2 commits into from

5 participants

@ev-br
Collaborator

Closes Statistics Review issues #704 and #705 by deprecating randwcdf and randwppf.
I cannot find a single use of either of them in either scipy or elsewhere.
For example: http://code.ohloh.net/search?s=randwppf
Probably these two can be just taken out.

@coveralls

Coverage Status

Coverage remained the same when pulling e30808e on EvgeniBurovski:randwcdf into b7aa678 on scipy:master.

@rgommers
Owner

Makes sense to me to deprecate these.

This way of deprecating works, but have you seen np.deprecate? You can use it as a decorator:

@np.deprecate(message="Deprecated in scipy 0.14.0, ...)
@ev-br
Collaborator

Thanks for the tip! The last commit uses it.

@coveralls

Coverage Status

Coverage remained the same when pulling 4868e1d on EvgeniBurovski:randwcdf into b7aa678 on scipy:master.

@josef-pkt
Collaborator

Looks good to me, I never found any use for those functions.

@rgommers
Owner

Looks good to me as well now. I posted a message to scipy-dev, let's merge this in a few days if no one objects.

@pv pv merged commit c7ab3c8 into from
@pv
Owner
pv commented

No objections, so merged.

@ev-br ev-br deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 3 deletions.
  1. +5 −3 scipy/stats/rv.py
View
8 scipy/stats/rv.py
@@ -1,6 +1,6 @@
from __future__ import division, print_function, absolute_import
-from numpy import vectorize
+from numpy import vectorize, deprecate
from numpy.random import random_sample
__all__ = ['randwppf', 'randwcdf']
@@ -11,7 +11,8 @@
# General purpose continuous
######################################
-
+@deprecate(message="Deprecated in scipy 0.14.0, use "
+ "distribution-specific rvs() method instead")
def randwppf(ppf, args=(), size=None):
"""
returns an array of randomly distributed integers of a distribution
@@ -26,7 +27,8 @@ def randwppf(ppf, args=(), size=None):
U = random_sample(size=size)
return ppf(*(U,)+args)
-
+@deprecate(message="Deprecated in scipy 0.14.0, use "
+ "distribution-specific rvs() method instead")
def randwcdf(cdf, mean=1.0, args=(), size=None):
"""
Returns an array of randomly distributed integers given a CDF.
Something went wrong with that request. Please try again.