Closed
Description
SciPy sparse matrices (i.e. scipy.sparse.*matrix
) are tested but their sparse arrays counterpart (i.e. scipy.sparse.*array
) aren't yet will become ubiquitous (see #26418).
Tests and their parameterizations (when they exist) must be adapted to include scipy.sparse.*array
conditionally to versions of SciPy that support them (i.e. scipy>=1.8
).
Steps
ℹ️ You can take #27095 as an example for your PRs.
1. Choose one of the files to adapt
- Indicate the file you are adapting (later referred to as
<filename>
) on this issue so no-one ends up duplicating work. E.g.
Hi, I am starting working on `<filename>`.
Please double check as this list might be outdated, but candidate files might be:
- TST Extend tests for
scipy.sparse.*array
intest_glm.py
#27107 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_affinity_propagation
#27095 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_bicluster.py
#27093 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_bisect_k_means.py
#27099 - TST Extend tests for
scipy.sparse.*array
intest_nmf.py
#27100 - TST Extend tests for
scipy.sparse.*array
insklearn/svm/tests/test_bounds.py
#27121 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_hdbscan.py
#27116 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_dbscan.py
+test_birch.py
+test_column_transformer.py
#27097 - TST Extend tests for
scipy.sparse.*array
insklearn/svm/tests/test_svm.py
#27128 - TST Extend tests for
scipy.sparse.*array
insklearn/decomposition/tests/test_incremental_pca.py
#27131 - TST Extend tests for
scipy.sparse.*array
insklearn/linear_model/tests/test_linear_loss.py
#27133 - TST Extend tests for
scipy.sparse.*array
insklearn/decomposition/tests/test_kernel_pca.py
#27143 - TST Extend tests for
scipy.sparse.*array
insklearn/decomposition/tests/test_online_lda.py
#27144 - TST Extend tests for
scipy.sparse.*array
insklearn/ensemble/tests/test_weight_boosting.py
#27148 - TST Extend tests for
scipy.sparse.*array
insklearn/decomposition/tests/test_pca.py
#27150 - TST Extend tests for
scipy.sparse.*array
insklearn/neighbors/tests/test_nearest_centroid.py
#27132 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_hierarchical.py
#27101 - TST Extend tests for
scipy.sparse.*array
insklearn/linear_model/tests/test_perceptron.py
#27160 - TST Extend tests for
scipy.sparse.*array
intest_lof.py
#27162 - TST Extend tests for
scipy.sparse.*array
intest_mlp.py
#27163 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_multioutput.py
#27171 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_class_weight.py
#27188 - TST Extend tests for
scipy.sparse.*array
intest_encoders.py
#27289 - TST Extend tests for
scipy.sparse.*array
insklearn/ensemble/tests/test_bagging.py
#27170 - TST Extend tests for
scipy.sparse.*array
insklearn/feature_selection/tests/test_mutual_info.py
#27173 - TST Extend tests for
scipy.sparse.*array
insklearn/feature_selection/tests/test_base.py
#27175 - TST Extend tests for
scipy.sparse.*array
insklearn/feature_selection/tests/test_chi2.py
#27176 - TST Extend tests for
scipy.sparse.*array
insklearn/feature_selection/tests/test_rfe.py
#27177 - TST Extend tests for
scipy.sparse.*array
insklearn/feature_selection/tests/test_sequential.py
#27178 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_utils.py
#27201 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_set_output.py
#27202 - TST Extend tests for
scipy.sparse.*array
insklearn/linear_model/tests/test_sag.py
#27206 - TST Extend tests for
scipy.sparse.*array
insklearn/impute/tests/test_impute.py
#27208 - TST Extend tests for
scipy.sparse.*array
insklearn/linear_model/tests/test_logistic.py
#27210 - TST Extend tests for
scipy.sparse.*array
insklearn/linear_model/tests/test_huber.py
#27211 - TST Extend tests for
scipy.sparse.*array
insklearn/metrics/tests/test_ranking.py
#27212 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_naive_bayes.py
#27213 - TST Extend tests for
scipy.sparse.*array
insklearn/ensemble/tests/test_stacking.py
#27214 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_dummy.py
#27215 - TST Extend tests for
scipy.sparse/*array
insklearn/ensemble/tests/test_forest
#27216 - TST Extend tests for
scipy.sparse/*array
insklearn/ensemble/tests/test_gradient_boosting
#27217 - TST Extend tests for
scipy.sparse/*array
insklearn/ensemble/tests/test_iforest
#27218 - TST Extend tests for
scipy.sparse/*array
insklearn/feature_extraction/tests/test_text
#27219 - TST Extend tests for
scipy.sparse.*array
insklearn/datasets/tests/test_svmlight_format.py
#27220 - TST Extend tests for
scipy.sparse.*array
insklearn/manifold/tests/test_t_sne.py
#27221 - TST Extend tests for
scipy.sparse/*array
insklearn/feature_selection/tests/test_variance_threshold
#27222 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_multiclass.py
#27223 - TST Extend tests for
scipy.sparse.*array
insklearn/tree/tests/test_monotonic_tree.py
#27224 - TST Extend tests for
scipy.sparse/*array
insklearn/linear_model/tests/test_base
#27225 - TST Extend tests for
scipy.sparse/*array
insklearn/linear_model/tests/test_coordinate_descent
#27226 - TST Extend tests for
scipy.sparse.*array
insklearn/preprocessing/tests/test_label.py
#27227 - TST Extend tests for
scipy.sparse/*array
insklearn/linear_model/tests/test_quantile
#27228 - TST Extend tests for
scipy.sparse.*array
insklearn/metrics/tests/test_dist_metrics.py
#27229 - TST Extend tests for
scipy.sparse.*array
insklearn/metrics/tests/test_pairwise_distances_reduction.py
#27230 - TST Extend tests for
scipy.sparse.*array
insklearn/metrics/tests/test_classification.py
#27231 - TST Extend tests for
scipy.sparse/*array
insklearn/linear_model/tests/test_ransac
#27233 - TST Extend tests for
scipy.sparse/*array
insklearn/linear_model/tests/test_ridge
#27235 - TST Extend tests for
scipy.sparse/*array
insklearn/linear_model/tests/test_sparse_coordinate_descent
#27237 - TST Extend tests for
scipy.sparse.*array
insklearn/feature_selection/tests/test_feature_select.py
#27239 - TST Extend tests for
scipy.sparse/*array
insklearn/metrics/cluster/tests/test_unsupervised
#27241 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_sparsefuncs.py
#27242 - TST Extend tests for
scipy.sparse/*array
insklearn/model_selection/tests/test_split
#27246 - TST Extend tests for
scipy.sparse/*array
insklearn/neural_network/tests/test_rbm
#27252 - TST Extend tests for
scipy.sparse/*array
insklearn/preprocessing/tests/test_data
#27253 - TST Extend tests for
scipy.sparse/*array
insklearn/preprocessing/tests/test_function_transformer
#27254 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_calibration.py
#27257 - TST Extend tests for
scipy.sparse/*array
insklearn/tree/tests/test_tree
#27261 - TST Extend tests for
scipy.sparse/*array
insklearn/utils/tests/test_extmath
#27262 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_kernel_ridge.py
#27270 - TST Extend tests for
scipy.sparse.*array
insklearn/linear_model/tests/test_passive_aggressive.py
#27273 - TST Extend tests for
scipy.sparse/*array
insklearn/utils/tests/test_multiclass
#27274 - TST Extend tests for
scipy.sparse/*array
insklearn/utils/tests/test_testing
#27276 - TST Extend tests for
scipy.sparse/*array
insklearn/impute/tests/test_common
#27277 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_pipeline.py
#27278 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_kernel_approximation.py
#27301 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_mocking.py
#27319 - TST Extend tests for
scipy.sparse.*array
insklearn/datasets/tests/test_openml.py
#27323 - TST Extend tests for
scipy.sparse.*array
insklearn/feature_selection/tests/test_base.py
#27175 - TST Extend tests for
scipy.sparse.*array
insklearn/manifold/tests/test_isomap.py
#27341 - TST Extend tests for
scipy.sparse.*array
insklearn\model_selection\tests\test_search.py
#27326 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_mocking.py
#27319 - TST Extend tests for
scipy.sparse.*array
inmodel_selection/tests/test_validation.py
#27366 - TST Extend tests for
scipy.sparse/*array
insklearn/neighbors/tests/test_neighbors
#27250 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_kernel_approximation.py
#27301 - TST Extend tests for
scipy.sparse.*array
intest_pairwise.py
#27288 - TST Extend tests for
scipy.sparse.*array
insklearn/datasets/tests/test_svmlight_format.py
#27220 - TST Extend tests for
scipy.sparse.*array
insklearn/covariance/tests/test_graphical_lasso.py
#27494 - TST Extend tests for
scipy.sparse.*array
intest_polynomial.py
#27166 - TST Extend tests for
scipy.sparse.*array
insklearn/metrics/tests/test_common.py
#27205 - TST Extend tests for
scipy.sparse.*array
insklearn/preprocessing/tests/test_common.py
#27164 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_k_means.py
#27179 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_optics.py
#27104 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_estimator_checks.py
#27203 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_shortest_path.py
#27502 - TST Extend tests for
scipy.sparse.*array
insklearn/utils/tests/test_seq_dataset.py
#27413 - TST Extend tests for
scipy.sparse/*array
insklearn/manifold/tests/test_spectral_embedding
#27240 - TST Extend tests for
scipy.sparse.*array
insklearn/tests/test_random_projection.py
#27314 - TST Extend tests for
scipy.sparse.*array
insklearn/svm/tests/test_sparse
#27723 - TST Extend tests for
scipy.sparse.*array
insklearn/cluster/tests/test_spectral.py
#27161 - FIX make 'array-like' reject sparse containers in parameter validation #28101
- TST Extend tests for
scipy.sparse.*array
insklearn/utils/_testing.py
#27847
2. Perform the following (non-exhaustive) changes for <filename>
- Add test parametrization for tests using
*_matrix
(for instance see eda7b16) - Adapt existing test parametrization to test against sparse array (for instance see 6717f99)
- Extend or add test checking that type of sparse containers are preserve by functions. E.g. adding tests like (as proposed by TST Extend tests for
scipy.sparse.*array
#27090 (comment)):sparse_input = sparse_container(...) sparse_output = process_sparse_container(sparse_input) assert isinstance(sparse_output, type(sparse_input))
- Run tests for this file:
# Run all the test in <filename> pytest <filename> -k test_to_run # Run a specific test in this file pytest <filename> -k test_to_run
- If tests fail, the tested implementations has to be adapted (let us know if you need help)
3. Create a pull request
- Use this title:
TST Extend tests for `scipy.sparse.*array` in `<filename>`
- Mention this issue in its description:
Towards #27090.
4. Once the pull request is created
- Ignore the error on the CI related the changelog: those PR need not update the changelog since nothing has changed for the users (until this issue is resolved), and maintainers must label PRs as "No Changelog Needed" for the check to be deactivated.