Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
* Better documentation where if_delegate_has_method is inapplicable
Fixes#19923
Introduces an elegant alternative for if_delegate_has_method, a decorator called available_if, which uses a callable to determine if an object should show a particular attribute.
If the callable also accepted the attribute name being decorated as a parameter, this could be used to implement if_delegate_has_method.
We could also replace if_delegate_has_method in all cases, since the code might be more readable as @available_if(lambda self, method: hasattr(self.base_estimator, method))
Possible alternative naming of available_if: hasattr_if.
TODO: add tests of the new decorator
* Fix use of super()
* Fixes to silly errors...
* add noqa
* Fix docstring issues
* remove debugging statements
* Use available_if instead of if_delegate_has_method in multioutput
* Public to private
* Rm unused import
* Black
* Use a sentinel instead of for-else with early return
* update reference docs
* TST
* DOC Add change log
* Update doc/whats_new/v1.0.rst
* Make test make sense
* Black
* Define available_if function in class
* Another way to express multioutput delegations
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
* Push scipy min version to 1.0.0
* Update all ubuntu images to 20.04 focal.
* Add ubuntu images 18.04 bionic and scipy fron conda-forge.
* Fix conditions.
* Pin python 3.6 for ubuntu bionic.
* Change pipeline name.
* Change matrix element name.
* Keep python 3.9 from system not conda in Ubuntu 20.04.
* Remove python directive when unnecessary.
* Cleanup.
* Downgrade to python 3.6 as scipy 1.0.0 is incompatible with 3.8.
* Fix comment.
* Fix comment.
* Pin pytest again as we are forced to use 3.6.
* Move to conda installer for 32bit linux.
* Install miniconda for ubuntu 32bit.
* Install wget for ubuntu 32bit.
* Revert 32bit OS to ubuntu bionic 18.04.
* Install scipy from pip in 32bit system.
* Fix doctest failures.
* Revert example rendering.
* Relax pytest version in ubuntu install.
* Skip failing tests.
* Put comment at the right place.
* Remove python3.6. Ubuntu32 still needs to be adapted.
* Push numpy and scipy min versions for compatibility with 3.7.
* Push matplotlib min version for compatibility with 3.7. Install numpy via pip in 32bit linux.
* Install numpy before scipy in Linux 32bit.
* Pass numpy version to linux32.
* Test 32bit architecture on debian buster (still exists for 32bit with python 3.7).
* Install matplotlib from distribution.
* Syntax error...
* Stick to the numpy debian version to avoid Expected 124 from C header, got 112 from PyObject error.
* Clean comments.
* Revert skip in doctest to check with new dependencies.
* Rename distrib.
* Skip again...
* Fix test on check_array.
* Remove comment and fix lint at the same time.
* Clean import.
* Increase atol in test_derivatives to make the test pass in py37_conda_openblas environment.
* Avoid sparse matrix dependent on scipy version.
* Skip docstring test for pandas versions less then 1.1.0.
* Fix lint error.
* Empty commit to force checks.
* Add minimal dependencies in changelog.
* Update to python 3.7 CircleCI and Travis builds.
* Move to debian buster for python3.7 dependencies.
* Fix the container tag.
* Lower the minimal pandas version for compatibility with python 3.7.