Skip to content

Commit 90548e4

Browse files
committed
fix linting
1 parent 18306a4 commit 90548e4

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tests/_util.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
# limitations under the License.
2121
#
2222
import collections.abc as collections_abc
23-
import packaging.version
2423
import functools
24+
25+
import packaging.version
2526
import pytest
2627
import sklearn.utils.estimator_checks
2728
import torch
@@ -66,12 +67,18 @@ def parametrize_slow(arg_names, fast_arguments, slow_arguments):
6667
def parametrize_with_checks_slow(fast_arguments, slow_arguments):
6768

6869
# NOTE(stes): See https://github.com/AdaptiveMotorControlLab/CEBRA/issues/280, sklearn API changed in 1.6.
69-
if packaging.version.parse(sklearn.__version__) <= packaging.version.parse("1.6"):
70-
generate_checks = functools.partial(sklearn.utils.estimator_checks.check_estimator, generate_only=True)
70+
if packaging.version.parse(
71+
sklearn.__version__) <= packaging.version.parse("1.6"):
72+
generate_checks = functools.partial(
73+
sklearn.utils.estimator_checks.check_estimator, generate_only=True)
7174
else:
7275
generate_checks = sklearn.utils.estimator_checks.estimator_checks_generator
73-
generate_params = lambda args: [next(generate_checks(arg)) for arg in args]
74-
return parametrize_slow("estimator,check", generate_params(fast_arguments), generate_params(slow_arguments))
76+
77+
def _generate_params(args):
78+
return [next(generate_checks(arg)) for arg in args]
79+
80+
return parametrize_slow("estimator,check", _generate_params(fast_arguments),
81+
_generate_params(slow_arguments))
7582

7683

7784
def parametrize_device(func):

0 commit comments

Comments
 (0)