From 7a4154f0547503c15273d0917aae600cdf0c87cf Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sun, 28 Apr 2024 00:34:14 +0300 Subject: [PATCH] Black formatting --- clearml/task_parameters.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/clearml/task_parameters.py b/clearml/task_parameters.py index f39b873f..e611a883 100644 --- a/clearml/task_parameters.py +++ b/clearml/task_parameters.py @@ -3,7 +3,7 @@ from attr import validators -__all__ = ['range_validator', 'param', 'percent_param', 'TaskParameters'] +__all__ = ["range_validator", "param", "percent_param", "TaskParameters"] def _canonize_validator(current_validator): @@ -35,23 +35,15 @@ def range_validator(min_value, max_value): :param max_value: The maximum limit of the range, inclusive. None for no maximum limit. :return: A new range validator. """ + def _range_validator(instance, attribute, value): - if ((min_value is not None) and (value < min_value)) or \ - ((max_value is not None) and (value > max_value)): + if ((min_value is not None) and (value < min_value)) or ((max_value is not None) and (value > max_value)): raise ValueError("{} must be in range [{}, {}]".format(attribute.name, min_value, max_value)) return _range_validator -def param( - validator=None, - range=None, - type=None, - desc=None, - metadata=None, - *args, - **kwargs -): +def param(validator=None, range=None, type=None, desc=None, metadata=None, *args, **kwargs): """ A parameter inside a TaskParameters class.