Skip to content

Commit f6f050a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5a6161f commit f6f050a

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

openml/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,4 @@ def __getattr__(name: str):
131131
return globals()[name]
132132
if name not in __all__:
133133
return get(name)
134+
return None

openml/utils/_indexing/_preindex_sklearn.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Registry lookup methods - scikit-learn estimators."""
2+
23
# adapted from the sktime utility of the same name
34
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
5+
from __future__ import annotations
46

57
__author__ = ["fkiraly"]
68
# all_estimators is also based on the sklearn utility of the same name
@@ -115,7 +117,7 @@ def _all_sklearn_estimators(
115117
will be the name of the column of estimator class names and the string(s)
116118
passed in return_tags will serve as column names for all columns of
117119
tags that were optionally requested.
118-
""" # noqa: E501
120+
"""
119121
from sklearn.base import BaseEstimator
120122

121123
MODULES_TO_IGNORE_SKLEARN = [
@@ -125,13 +127,11 @@ def _all_sklearn_estimators(
125127
"conftest",
126128
]
127129

128-
result = all_objects(
130+
return all_objects(
129131
object_types=BaseEstimator,
130132
package_name=package_name,
131133
modules_to_ignore=MODULES_TO_IGNORE_SKLEARN,
132134
as_dataframe=as_dataframe,
133135
return_names=return_names,
134136
suppress_import_stdout=suppress_import_stdout,
135137
)
136-
137-
return result

openml/utils/_inmemory/_dict.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Utilities module for serializing and deserializing dicts."""
22

3+
from __future__ import annotations
4+
35

46
def serialize_dict(d, mode="eval", name="d"):
57
"""Serialize a dict as an executable Python code snippet.
@@ -40,13 +42,14 @@ def serialize_dict(d, mode="eval", name="d"):
4042
>>> deserialized_dict = eval(serialized_dict)
4143
>>> assert deserialized_dict == my_dict
4244
"""
45+
4346
def dq(s):
4447
# Escape backslashes and double quotes for valid Python strings
4548
return s.replace("\\", "\\\\").replace('"', '\\"')
4649

4750
if mode == "eval":
4851
lines = ["{"]
49-
else: # mode == "exec"
52+
else: # mode == "exec"
5053
lines = [f"{name} = {{"]
5154
for k, v in d.items():
5255
lines.append(f' "{dq(k)}": "{dq(v)}",')

openml/utils/_openml.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import openml
1818
import openml._api_calls
1919
import openml.exceptions
20-
2120
from openml import config
2221

2322
# Avoid import cycles: https://mypy.readthedocs.io/en/latest/common_issues.html#import-cycles

0 commit comments

Comments
 (0)