Commit Graph

64 Commits

Author SHA1 Message Date
Jérémie du Boisberranger cd1b1bef0e
MAINT cleanup utils.__init__: move IS_PYPY, _IS_WASM, _IS_32BIT into utils.fixes (#28768)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2024-04-08 09:07:26 +00:00
Yao Xiao de7a43fa3c
FIX safe indexing for polars `Series` (#28521)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2024-03-06 15:45:48 +01:00
Loïc Estève ad3addd37f
CI Use environment variable to turn warnings into errors in tests and doc build (#28372)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2024-02-08 18:54:36 +01:00
Loïc Estève d61b65e644
CI Unpin pytest and regenerate lock-files (#28318) 2024-01-31 18:14:14 +01:00
Guillaume Lemaitre 69cef4adc1
FIX _convert_container should be able to convert from sparse to sparse (#28185)
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2024-01-22 09:53:04 +00:00
Loïc Estève 71e5271d8b
TST Skip test using subprocess in Pyodide (#28116) 2024-01-13 09:56:00 +01:00
Loïc Estève 55c6679ada
TST Tweak tests to facilitate Meson usage (#28094)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2024-01-12 14:44:41 +00:00
Jérôme Dockès e1ce967a33
ENH detect categorical polars columns in HistGradientBoosting (#27835)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2023-12-05 10:15:06 +01:00
Olivier Grisel c6d0d29b19
FIX update create_memmap_backed_data to work on any estimator object via joblib 1.2.0 and later (#27614) 2023-10-22 19:54:01 +02:00
Loïc Estève 751ccc0a4d
CI Run test suite inside Pyodide (#27346)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2023-09-28 17:57:20 -04:00
Yao Xiao 7dd3e4e21c
TST Extend tests for `scipy.sparse/*array` in `sklearn/utils/tests/test_testing` (#27276) 2023-09-12 18:40:23 +02:00
Adrin Jalali 42173fdb34
MNT add isort to ruff's rules (#26649) 2023-06-21 17:50:07 +02:00
Adrin Jalali 893d5accaf
MNT Update black to 23.3.0 (#26110) 2023-04-06 12:14:16 -04:00
Jérémie du Boisberranger 9260f510ab
MAINT Clean-up deprecated if_delegate_has_method for 1.3 (#25879) 2023-03-16 17:13:03 -04:00
Thomas J. Fan 28f8c87391
MAINT Removes ReadOnlyWrapper (#25586) 2023-02-11 17:35:01 +01:00
Jérémie du Boisberranger b79423ea3e
MAINT Clean deprecation for 1.2: assert_warns (#24442) 2022-09-15 16:36:50 +02:00
Loïc Estève 79c21c57aa
TST Make sure memmap are aligned when OpenBLAS detects Prescott architecture (#23994) 2022-07-26 10:38:01 -04:00
Dimitri Papadopoulos Orfanos ee5a1b69d1
DOC, MNT Typos found by codespell (#22906) 2022-03-20 19:16:39 +01:00
Jérémie du Boisberranger b9bd2d524d
API Deprecate if_delegate_has_method (#22830) 2022-03-17 13:16:53 -04:00
Julien Jerphanion 613773db11
TST Add minimal setup to be able to run test suite on float32 (#22690)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
2022-03-17 14:25:17 +01:00
Thomas J. Fan 30c89280ce
MAINT Adjust tests for numpydoc 1.2 (#22287)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2022-02-11 17:11:50 +01:00
Christian Lorentzen 3f717cc48a
[MRG] FIX segmentation fault on memory mapped contiguous memoryview (#21654) 2021-11-18 14:55:48 +01:00
Guillaume Lemaitre a8d28274ef
MNT replace if_delagate_has_method by available_if in testing (#20686)
* MNT replace if_delagate_has_method by available_if in testing

* iter
2021-08-31 12:39:46 +02:00
Olivier Grisel 504682172b
MAINT deprecate assert_warns and assert_warns_messsage (#20521)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-07-20 15:01:16 +02:00
Juan Martin Loyola b0cac5339a
TST Replace assert_warns with pytest context manager in sklearn/utilst/tests/test_testing.py (#20436) 2021-07-06 10:58:29 +02:00
Juan Martin Loyola 0d343bb2d2
Replace assert_warns* with pytest context manager in sklearn/utilst/tests/* (#20421) 2021-06-30 23:57:16 +02:00
Thomas J. Fan 3ae7c76153
STY Enables black with experimental_string_processing=true (#20412) 2021-06-29 09:47:04 +02:00
Thomas J. Fan 82df48934e
MNT Applies black formatting to most of the code base (#18948) 2021-06-17 14:21:09 -04:00
Andrew Delong a67b284f90
FIX Encoder should accept categories having dtype='S' (#19727)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-04-21 17:34:28 -04:00
Nicolas Hug 5721629fd3
MNT Use a pytest-like context manager in estimator_checks.py (#18418) 2020-09-28 15:05:43 -04:00
Nicolas Hug 1931e142ed
Remove deprecated utils (#17133) 2020-05-20 22:03:54 +02:00
Roman Feldbauer 9b39c4c4d2
TST Fix unreachable code in tests (#16110) 2020-02-16 14:41:26 +01:00
Alexandre Batisse 418e0d55d3
[MRG] CLN Remove the use of assert_raises in utils/ (#16337)
* CLN use pytest raises ctxt manager for class weights & estimators [skip ci]

* CLN use pytest raises ctxt manager for multiclass test

* CLN use pytest warns in estimator checks test

* CLN use pytest raises ctxt manager for random test

* CLN use pytest raises ctxt manager for sparsefuncs test

* CLN use pytest raises ctxt manager for testing utils tests

* CLN use pytest raises ctxt manager for utils tests

* CLN use pytest raises ctxt manager for validation tests

* revert test_estimator_check.py to upstream master
2020-02-02 14:44:19 +01:00
Guillaume Lemaitre c311efd501 FIX accept pandas Index for feature_names in PDP (#15639) 2019-11-18 06:39:43 -06:00
Nicolas Hug 19ad136223 MNT Replace DeprecationWarning with FutureWarning (#15080)
* bruteforce renaming

* WIP

* WIP

* some more

* removed weird line

* update -Werror

* testiforest

* again

* Fixed some tests

* fixed some tests

* removed -Werror

* fixed test_docstring_param issue

* fixed some tests

* some more

* renamed to SklearnDeprecationWarning

* pep8

* updated docs

* pep8

* merge

* changed to FutureWarning

* fixes

* Update doc/developers/tips.rst

Co-Authored-By: Adrin Jalali <adrin.jalali@gmail.com>

* avoid duplicates

* fixed warning for deprecations

* Still make CI break if DeprecationWarning isn't caught

* updated one warning

* fixed test

* fixed some renamings

* updated new dep warnings

* fixed bad import

* ignore warnings

* update again

* ignore futurewarning when walking packages

* Fixed test

* pep8

* Added whatsnew
2019-10-29 15:39:26 +01:00
Nicolas Hug b92455a6b2 MAINT Deprecate all of utils.testing except all_estimators (#15367) 2019-10-28 17:28:56 +01:00
Nicolas Hug f3eb9d2206 [MRG] MNT removing assert_equal, etc -- continued (#14232) 2019-07-02 14:53:51 +10:00
Adrin Jalali 19c068a2ec MNT towards removing assert_equal, etc (#14222) 2019-07-01 09:13:32 -04:00
Antonio Gutierrez 8681ece373 ENH Fix unfriendly error message for documentation checks (#11967)
Previously error messages for mismatches parameters on function/method
signatures and docstrings were not explicit or user-friendly. This
changes provides a more explicit error message and in addition notifies
the relation of missing/mismatching parameters from signature to
docstring and from docstring to signature.
2019-06-21 17:06:57 -07:00
Roman Yurchak 0e3bb17e62 MAINT Run pyupgrade following Python2 deprecation (#12997) 2019-02-08 20:13:34 +08:00
Hanmin Qin 575064b8e1
MNT More clean up after we remove python < 3.5 (#13078) 2019-02-02 22:01:13 +08:00
Loïc Estève e1dd0d85c4 FIX: ensure that category warning are passed as a kwargs in ignore_warnings (#11599) 2018-07-17 22:50:32 +02:00
Shangwu Yao cb1dbc25a7 MNT: reduce the number of warnings in test_common.py (#11151)
Improve handling of warning filters in sklearn.utils.testing by avoiding to reset warnings.filters.
2018-06-11 08:59:12 +02:00
Loïc Estève 9ea723f07a [MRG+1] Read-only memmap input data in common tests (#10663) 2018-04-23 14:58:40 +02:00
Joel Nothman 116c96c7cc [MRG] CI Reinstate docstring testing (#10473) 2018-02-10 08:47:42 -08:00
Kumar Ashutosh 2b9405f977 [MRG] Backports msg in assert_raises and assert_raises_regex (#9536)
* Added modifiedunittest

* Backports msg in assertRaises and assertRaisesRegexp

* Import statement corrected

* Corrected import statement

* Added module name in utils.setup.py

* Removed Extra modules

* Reordered class

* _is_subtype added

* Missing import added

* _formatMessage added

* missing variables added

* Remove PEP8 failures

* Removed safe_repr

* _unittest_backport.py added

* Import statement corrected

* Added copyright

* Syntax Error removed

* Error removed

* runTest function added

* Tests added

* __init__ added

* Import added
2017-08-17 09:05:24 +10:00
(Venkat) Raghav, Rajagopalan b6f8865b0a [MRG + 1 (rv) + 1 (alex) + 1] Add a check to test the docstring params and their order (#9206)
* add automatic test of docstrings for function / method signatures using numpydoc
2017-07-11 18:42:10 +02:00
Andreas Mueller d788dcb199 [MRG+1] Instance level common tests (#9019)
* start work on separating instance-level tests

* minor refactoring / fixes to work without tags

* add clone into check_supervised_y_2d estimator check (which made other checks fail)

* remove duplicate check_estimator_unfitted assert

* add issue reference to whatsnew entry

* added some clones, minor fixes from vene's review

* rename estimator arg to estimator_org to make a visible distinction before and after cloning.

* more renaming for more explicit clones

* org -> orig

* allclose, fix orig stuff

* don't use set_testing_parameters in the checks!

* minor fixes for allclose

* fix some test, add more tests on classes

* added the test using pickles.

* move assert_almost_equal_dense_sparse to utils.testing, rename to assert_allclose_sparse_dense, test it

* make assert_allclose_dense_sparse more stringent

* more allclose fixes

* run test_check_estimator on all estimators

* rename set_testing_parameters to set_checking_parameters so nose doesn't think it's a tests (and I don't want to import stuff from nose as we want to remove it)

* fix in set_checking_parameters so that common tests pass

* more fixes to assert_allclose_dense_sparse

* rename alg to clusterer, don't scream even though I really want to

* ok this is not a pretty strict test that runs check_estimator with and without fitting on an instance. I also check if ``fit`` is called on the instance that is passed.

* simplify test as they didn't help at all

* it works!!! omfg

* run check_estimator clone test only on one of the configs, don't run locally by default

* Add `slow_test` decorator and documentation

* run test_check_estimator only on some estimators

* fix diags in test for older scipy

* fix pep8 and shorten

* use joblib.hash for inequality check because the pickle state machine is weird
2017-06-09 16:33:57 +02:00
Loïc Estève e5bf61eee1 [MRG+1] Dropping python 2.6 support (#7890)
* Remove Python 2.6 support

Some details about some slightly orthogonal changes:
* Note about cheking safely for nan is likely not valid any more (commit
  introducing it is c80ca91b)
* scipy.linalg.qr econ parameter removed since scipy 0.9 in favour of
  mode='economic'
* Remove unnecessary libgfortran in conda create command

* Putative fix by setting the random seed

* Revert unintended change

* Reinstate previous logic for checking for NaNs

* Reinstate change in error message

Error messages from Python 2.7 assertRegexp does not contain the
function name, in contrast with Python 3 assertRegex
2016-11-23 17:11:04 -05:00
Konstantin Podshumok 9b2aac9e5c [MRG + 1] [TST] (half-cosmetic) use less nose.tools import to simplify future transition to py.test (#7384)
* use less nose.tools import to simplify future transition to activly developing test suites/runners

* assert_equal -> assert_array_equal in test_feature_hasher_pairs_with_string_values

and one missed ImportError that should be replaced with AttributeError

* test for py2.6 compat with except AttributeError

* fix importing of SkipTest

* force using nose in python2.6 for now

* there was no assert_dict_equal in py2.6. but we can use assert_equal

although failed test will look a little bit ugly

* remove nose imports from doc/datasets
2016-10-07 12:46:52 -04:00