Skip to content

Commit

Permalink
Merge branch 'main' into release-0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fkiraly committed Sep 22, 2024
2 parents 63db970 + 320c206 commit 4c78f59
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
3 changes: 2 additions & 1 deletion skbase/base/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,8 @@ def _clone(estimator, *, safe=True):
found in :ref:`randomness`.
"""
estimator_type = type(estimator)
# XXX: not handling dictionaries
if estimator_type is dict:
return {k: _clone(v, safe=safe) for k, v in estimator.items()}
if estimator_type in (list, tuple, set, frozenset):
return estimator_type([_clone(e, safe=safe) for e in estimator])
elif not hasattr(estimator, "get_params") or isinstance(estimator, type):
Expand Down
6 changes: 5 additions & 1 deletion skbase/testing/test_all_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,13 @@ def test_clone(self, object_instance):
assert not obj_clone.is_fitted

def test_repr(self, object_instance):
"""Check we can call repr."""
"""Check that __repr__ call to instance does not raise exceptions."""
repr(object_instance)

def test_repr_html(self, object_instance):
"""Check that _repr_html_ call to instance does not raise exceptions."""
object_instance._repr_html_()

def test_constructor(self, object_class):
"""Check that the constructor has sklearn compatible signature and behaviour.
Expand Down
18 changes: 0 additions & 18 deletions skbase/utils/dependencies/_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
from packaging.version import InvalidVersion, Version


# todo 0.10.0: remove suppress_import_stdout argument
def _check_soft_dependencies(
*packages,
package_import_alias="deprecated",
severity="error",
obj=None,
msg=None,
suppress_import_stdout="deprecated",
):
"""Check if required soft dependencies are installed and raise error or warning.
Expand Down Expand Up @@ -68,22 +66,6 @@ def _check_soft_dependencies(
-------
boolean - whether all packages are installed, only if no exception is raised
"""
# todo 0.10.0: remove this warning
if suppress_import_stdout != "deprecated":
warnings.warn(
"In skbase _check_soft_dependencies, the suppress_import_stdout argument "
"is deprecated and no longer has any effect. "
"The argument will be removed in version 0.10.0, so users of the "
"_check_soft_dependencies utility should not pass this argument anymore. "
"The _check_soft_dependencies utility also no longer causes imports, "
"hence no stdout "
"output is created from imports, for any setting of the "
"suppress_import_stdout argument. If you wish to import packages "
"and make use of stdout prints, import the package directly instead.",
DeprecationWarning,
stacklevel=2,
)

if len(packages) == 1 and isinstance(packages[0], (tuple, list)):
packages = packages[0]
if not all(isinstance(x, str) for x in packages):
Expand Down

0 comments on commit 4c78f59

Please sign in to comment.