Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct deprecate positional args decorator for CalVer #3784

Merged
merged 2 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions python/cuml/_thirdparty/sklearn/preprocessing/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _handle_zeros_in_scale(scale, copy=True):
return scale


@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
@api_return_generic(get_output_type=True)
def scale(X, *, axis=0, with_mean=True, with_std=True, copy=True):
"""Standardize a dataset along any axis
Expand Down Expand Up @@ -289,7 +289,7 @@ class MinMaxScaler(TransformerMixin,
data_max_ = CumlArrayDescriptor()
data_range_ = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, feature_range=(0, 1), *, copy=True):
self.feature_range = feature_range
self.copy = copy
Expand Down Expand Up @@ -434,7 +434,7 @@ def inverse_transform(self, X) -> CumlArray:
return X


@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
@api_return_generic(get_output_type=True)
def minmax_scale(X, feature_range=(0, 1), *, axis=0, copy=True):
"""Transform features by scaling each feature to a given range.
Expand Down Expand Up @@ -613,7 +613,7 @@ class StandardScaler(TransformerMixin,
mean_ = CumlArrayDescriptor()
var_ = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, *, copy=True, with_mean=True, with_std=True):
self.with_mean = with_mean
self.with_std = with_std
Expand Down Expand Up @@ -918,7 +918,7 @@ class MaxAbsScaler(TransformerMixin,
n_samples_seen_ = CumlArrayDescriptor()
max_abs_ = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, *, copy=True):
self.copy = copy

Expand Down Expand Up @@ -1040,7 +1040,7 @@ def inverse_transform(self, X) -> SparseCumlArray:
return X


@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
@api_return_generic(get_output_type=True)
def maxabs_scale(X, *, axis=0, copy=True):
"""Scale each feature to the [-1, 1] range without breaking the sparsity.
Expand Down Expand Up @@ -1175,7 +1175,7 @@ class RobustScaler(TransformerMixin,
center_ = CumlArrayDescriptor()
scale_ = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, *, with_centering=True, with_scaling=True,
quantile_range=(25.0, 75.0), copy=True):
self.with_centering = with_centering
Expand Down Expand Up @@ -1301,7 +1301,7 @@ def inverse_transform(self, X) -> SparseCumlArray:
return X


@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
@api_return_generic(get_output_type=True)
def robust_scale(X, *, axis=0, with_centering=True, with_scaling=True,
quantile_range=(25.0, 75.0), copy=True):
Expand Down Expand Up @@ -1448,7 +1448,7 @@ class PolynomialFeatures(TransformerMixin,
exponentially in the degree. High degrees can cause overfitting.
"""

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, degree=2, *, interaction_only=False, include_bias=True,
order='C'):
self.degree = degree
Expand Down Expand Up @@ -1662,7 +1662,7 @@ def transform(self, X) -> SparseCumlArray:
return XP # TODO keep order


@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
@api_return_generic(get_output_type=True)
def normalize(X, norm='l2', *, axis=1, copy=True, return_norm=False):
"""Scale input vectors individually to unit norm (vector length).
Expand Down Expand Up @@ -1808,7 +1808,7 @@ class Normalizer(TransformerMixin,
normalize: Equivalent function without the estimator API.
"""

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, norm='l2', *, copy=True):
self.norm = norm
self.copy = copy
Expand Down Expand Up @@ -1842,7 +1842,7 @@ def transform(self, X, copy=None) -> SparseCumlArray:
return normalize(X, norm=self.norm, axis=1, copy=copy)


@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
@api_return_generic(get_output_type=True)
def binarize(X, *, threshold=0.0, copy=True):
"""Boolean thresholding of array-like or sparse matrix
Expand Down Expand Up @@ -1937,7 +1937,7 @@ class Binarizer(TransformerMixin,
binarize: Equivalent function without the estimator API.
"""

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, *, threshold=0.0, copy=True):
self.threshold = threshold
self.copy = copy
Expand Down Expand Up @@ -2235,7 +2235,7 @@ class QuantileTransformer(TransformerMixin,
<sphx_glr_auto_examples_preprocessing_plot_all_scaling.py>`.
"""

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, *, n_quantiles=1000, output_distribution='uniform',
ignore_implicit_zeros=False, subsample=int(1e5),
random_state=None, copy=True):
Expand Down Expand Up @@ -2565,7 +2565,7 @@ def inverse_transform(self, X):
return self._transform(X, inverse=True)


@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def quantile_transform(X, *, axis=0, n_quantiles=1000,
output_distribution='uniform',
ignore_implicit_zeros=False,
Expand Down Expand Up @@ -2767,7 +2767,7 @@ class PowerTransformer(TransformerMixin,
of the Royal Statistical Society B, 26, 211-252 (1964).

"""
@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, method='yeo-johnson', *, standardize=True, copy=True):
self.method = method
self.standardize = standardize
Expand Down Expand Up @@ -3035,7 +3035,7 @@ def _check_input(self, X, in_fit, check_positive=False, check_shape=False,
return X


@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def power_transform(X, method='yeo-johnson', *, standardize=True, copy=True):
"""
Power transforms are a family of parametric, monotonic transformations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class KBinsDiscretizer(TransformerMixin,
bin_edges_ = CumlArrayDescriptor()
n_bins_ = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, n_bins=5, *, encode='onehot', strategy='quantile'):
self.n_bins = n_bins
self.encode = encode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class SimpleImputer(_BaseImputer, BaseEstimator,

statistics_ = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, *, missing_values=np.nan, strategy="mean",
fill_value=None, copy=True, add_indicator=False):
super().__init__(
Expand Down Expand Up @@ -534,7 +534,7 @@ class MissingIndicator(TransformerMixin,
"""
features_ = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, *, missing_values=np.nan, features="missing-only",
sparse="auto", error_on_new=True):
self.missing_values = missing_values
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/ensemble/randomforest_common.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class BaseRandomForestModel(Base):
"random_state is set")
if quantile_per_tree:
warnings.warn("The 'quantile_per_tree' parameter is deprecated "
"and will be removed in 0.20 release. Instead use "
"and will be removed in 21.06 release. Instead use "
"higher number of global quantile bins.")
if handle is None:
handle = Handle(n_streams)
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/internals/base_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def __new__(cls, classname, bases, classDict):
# If attributeName is `__init__`, wrap in the decorator to
# deprecate positional args
if (attributeName == "__init__"):
attribute = _check_and_wrap_init(attribute, version="0.20")
attribute = _check_and_wrap_init(attribute, version="21.06")
classDict[attributeName] = attribute

# For now, skip all additional processing if we are a dask
Expand Down
6 changes: 3 additions & 3 deletions python/cuml/multiclass/multiclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class MulticlassClassifier(Base, ClassifierMixin):
Number of classes.

"""
@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self,
estimator,
*,
Expand Down Expand Up @@ -208,7 +208,7 @@ class OneVsRestClassifier(MulticlassClassifier):
module level, `cuml.global_settings.output_type`.
See :ref:`output-data-type-configuration` for more info.
"""
@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self,
estimator,
*args,
Expand Down Expand Up @@ -274,7 +274,7 @@ class OneVsOneClassifier(MulticlassClassifier):
module level, `cuml.global_settings.output_type`.
See :ref:`output-data-type-configuration` for more info.
"""
@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self,
estimator,
*args,
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/tsa/arima.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class ARIMA(Base):
sma_ = CumlArrayDescriptor()
sigma2_ = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self,
endog,
*,
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/tsa/auto_arima.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class AutoARIMA(Base):

d_y = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self,
endog,
*,
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/tsa/holtwinters.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class ExponentialSmoothing(Base):
season = CumlArrayDescriptor()
SSE = CumlArrayDescriptor()

@_deprecate_pos_args(version="0.20")
@_deprecate_pos_args(version="21.06")
def __init__(self, endog, *, seasonal="additive",
seasonal_periods=2, start_periods=2,
ts_num=1, eps=2.24e-3, handle=None,
Expand Down