Skip to content

Commit 9aed703

Browse files
CI Cleanup pytest warning/errors (#495)
* Clean up deprecation warnings in pyproject.toml Ran the gha on my fork and all besides 1 is still needed. * ignore `PassiveAggressiveClassifier`'s `FutureWarning` Co-authored-by: Adrin Jalali <[email protected]> * ignore PassiveAgressive(Classifier|Regressor) warnings * fix SparseCoder test --------- Co-authored-by: Adrin Jalali <[email protected]>
1 parent 0fa536e commit 9aed703

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

pyproject.toml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,11 @@ doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"
7070
filterwarnings = [
7171
"error::DeprecationWarning",
7272
"error::FutureWarning",
73-
# TODO: remove when no longer supporting sklearn v1.0
74-
# numpy and scipy deprecation warnings in sklearn:
75-
'ignore:\n\n \`numpy.distutils\` is deprecated since NumPy:DeprecationWarning',
76-
# https://github.com/scikit-learn/scikit-learn/issues/24080
77-
"ignore:The \\'sym_pos\\' keyword is deprecated and should be replaced:DeprecationWarning",
78-
# https://github.com/scikit-learn/scikit-learn/pull/23633
79-
"ignore:Unlike other reduction functions:FutureWarning",
80-
# https://github.com/scikit-learn/scikit-learn/pull/25157
81-
"ignore:\\w+ is deprecated. Use files\\(\\) instead:DeprecationWarning",
8273
# comes from fairlearn
83-
"ignore:DataFrame.applymap has been deprecated. Use DataFrame.map instead:FutureWarning",
8474
"ignore:DataFrameGroupBy.apply operated on the grouping columns.:DeprecationWarning",
85-
# Ignore Pandas 2.2 warning on PyArrow. It might be reverted in a later release.
86-
"ignore:\\s*Pyarrow will become a required dependency of pandas.*:DeprecationWarning",
87-
# LightGBM sklearn 1.6 deprecation warning, fixed in the next release
88-
"ignore:'force_all_finite' was renamed to 'ensure_all_finite' in 1.6 and will be removed in 1.8.:FutureWarning",
89-
# RandomForestQuantileRegressor tags deprecation warning in sklearn 1.7
90-
"ignore:The RandomForestQuantileRegressor or classes from which it inherits use `_get_tags` and `_more_tags`:FutureWarning",
91-
# ExtraTreesQuantileRegressor tags deprecation warning in sklearn 1.7
92-
"ignore:The ExtraTreesQuantileRegressor or classes from which it inherits use `_get_tags` and `_more_tags`:FutureWarning",
93-
# BaseEstimator._validate_data deprecation warning in sklearn 1.6 #TODO can be removed when a new release of quantile-forest is out
94-
"ignore:`BaseEstimator._validate_data` is deprecated in 1.6 and will be removed in 1.7:FutureWarning",
95-
# This comes from matplotlib somehow
96-
"ignore:'mode' parameter is deprecated and will be removed in Pillow 13:DeprecationWarning",
75+
# sklearn1.8 deprecates this class
76+
"ignore:Class PassiveAggressiveClassifier is deprecated:FutureWarning",
77+
"ignore:Class PassiveAggressiveRegressor is deprecated:FutureWarning",
9778
]
9879
addopts = "--cov=skops --cov-report=term-missing --doctest-modules"
9980

skops/io/tests/test_persist.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ def _tested_estimators(type_filter=None):
148148
# default solver will be "highs" from scikit-learn >= 1.4.0.
149149
# https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.QuantileRegressor.html
150150
estimators = construct_instances(partial(Estimator, solver="highs"))
151+
elif name == "SparseCoder":
152+
dictionary = np.random.randint(-2, 3, size=(5, N_FEATURES)).astype(
153+
float
154+
)
155+
estimators = [
156+
SparseCoder(
157+
dictionary=dictionary,
158+
transform_algorithm="lasso_lars",
159+
)
160+
]
151161
else:
152162
estimators = construct_instances(Estimator)
153163

@@ -247,12 +257,6 @@ def _tested_estimators(type_filter=None):
247257
n_iter=3,
248258
)
249259

250-
dictionary = np.random.randint(-2, 3, size=(5, N_FEATURES)).astype(float)
251-
yield SparseCoder(
252-
dictionary=dictionary,
253-
transform_algorithm="lasso_lars",
254-
)
255-
256260

257261
def _tested_ufuncs():
258262
for full_name in SCIPY_UFUNC_TYPE_NAMES + NUMPY_UFUNC_TYPE_NAMES:

0 commit comments

Comments
 (0)