Skip to content
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
1 change: 0 additions & 1 deletion sklearn/tests/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"sklearn.utils.fixes.threadpool_limits",
"sklearn.utils.gen_batches",
"sklearn.utils.gen_even_slices",
"sklearn.utils.metaestimators.available_if",
"sklearn.utils.metaestimators.if_delegate_has_method",
]
FUNCTION_DOCSTRING_IGNORE_LIST = set(FUNCTION_DOCSTRING_IGNORE_LIST)
Expand Down
8 changes: 7 additions & 1 deletion sklearn/utils/metaestimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def out(*args, **kwargs):


def available_if(check):
"""An attribute that is available only if check returns a truthy value
"""An attribute that is available only if check returns a truthy value.

Parameters
----------
Expand All @@ -150,6 +150,12 @@ def available_if(check):
a truthy value if the attribute is available, and either return False
or raise an AttributeError if not available.

Returns
-------
callable
Callable makes the decorated method available if `check` returns
a truthy value, otherwise the decorated method is unavailable.

Examples
--------
>>> from sklearn.utils.metaestimators import available_if
Expand Down