Skip to content

Commit 3e733eb

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

27 files changed

+17
-84
lines changed

examples/30_extended/fetch_runtimes_tutorial.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
)
8080
)
8181

82+
8283
# Creating utility function
8384
def print_compare_runtimes(measures):
8485
for repeat, val1 in measures["usercpu_time_millis_training"].items():

openml/_api_calls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ def __parse_server_exception(
386386
url: str,
387387
file_elements: Dict,
388388
) -> OpenMLServerError:
389-
390389
if response.status_code == 414:
391390
raise OpenMLServerError("URI too long! ({})".format(url))
392391
try:

openml/datasets/dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ def _get_repr_body_fields(self) -> List[Tuple[str, Union[str, int, List[str]]]]:
274274
return [(key, fields[key]) for key in order if key in fields]
275275

276276
def __eq__(self, other):
277-
278277
if type(other) != OpenMLDataset:
279278
return False
280279

openml/datasets/functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def list_datasets(
7474
output_format: str = "dict",
7575
**kwargs,
7676
) -> Union[Dict, pd.DataFrame]:
77-
7877
"""
7978
Return a list of all dataset which are on OpenML.
8079
Supports large amount of results.
@@ -182,7 +181,6 @@ def _list_datasets(data_id: Optional[List] = None, output_format="dict", **kwarg
182181

183182

184183
def __list_datasets(api_call, output_format="dict"):
185-
186184
xml_string = openml._api_calls._perform_api_call(api_call, "get")
187185
datasets_dict = xmltodict.parse(xml_string, force_list=("oml:dataset",))
188186

openml/extensions/sklearn/extension.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,6 @@ def flatten_all(list_):
10281028
# when deserializing the parameter
10291029
sub_components_explicit.add(identifier)
10301030
if isinstance(sub_component, str):
1031-
10321031
external_version = self._get_external_version_string(None, {})
10331032
dependencies = self._get_dependencies()
10341033
tags = self._get_tags()
@@ -1079,7 +1078,6 @@ def flatten_all(list_):
10791078
parameters[k] = parameter_json
10801079

10811080
elif isinstance(rval, OpenMLFlow):
1082-
10831081
# A subcomponent, for example the base model in
10841082
# AdaBoostClassifier
10851083
sub_components[k] = rval
@@ -1769,7 +1767,6 @@ def _prediction_to_probabilities(
17691767
)
17701768

17711769
if isinstance(task, (OpenMLClassificationTask, OpenMLLearningCurveTask)):
1772-
17731770
try:
17741771
proba_y = model_copy.predict_proba(X_test)
17751772
proba_y = pd.DataFrame(proba_y, columns=model_classes) # handles X_test as numpy

openml/flows/functions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def _get_flow_description(flow_id: int) -> OpenMLFlow:
120120
try:
121121
return _get_cached_flow(flow_id)
122122
except OpenMLCacheException:
123-
124123
xml_file = os.path.join(
125124
openml.utils._create_cache_directory_for_id(FLOWS_CACHE_DIR_NAME, flow_id),
126125
"flow.xml",
@@ -140,7 +139,6 @@ def list_flows(
140139
output_format: str = "dict",
141140
**kwargs
142141
) -> Union[Dict, pd.DataFrame]:
143-
144142
"""
145143
Return a list of all flows which are on OpenML.
146144
(Supports large amount of results)
@@ -332,7 +330,6 @@ def get_flow_id(
332330

333331

334332
def __list_flows(api_call: str, output_format: str = "dict") -> Union[Dict, pd.DataFrame]:
335-
336333
xml_string = openml._api_calls._perform_api_call(api_call, "get")
337334
flows_dict = xmltodict.parse(xml_string, force_list=("oml:flow",))
338335

openml/runs/functions.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ def _calculate_local_measure(sklearn_fn, openml_name):
505505
user_defined_measures_fold[openml_name] = sklearn_fn(test_y, pred_y)
506506

507507
if isinstance(task, (OpenMLClassificationTask, OpenMLLearningCurveTask)):
508-
509508
for i, tst_idx in enumerate(test_indices):
510509
if task.class_labels is not None:
511510
prediction = (
@@ -549,7 +548,6 @@ def _calculate_local_measure(sklearn_fn, openml_name):
549548
)
550549

551550
elif isinstance(task, OpenMLRegressionTask):
552-
553551
for i, _ in enumerate(test_indices):
554552
truth = test_y.iloc[i] if isinstance(test_y, pd.Series) else test_y[i]
555553
arff_line = format_prediction(
@@ -570,7 +568,6 @@ def _calculate_local_measure(sklearn_fn, openml_name):
570568
)
571569

572570
elif isinstance(task, OpenMLClusteringTask):
573-
574571
for i, _ in enumerate(test_indices):
575572
arff_line = [test_indices[i], pred_y[i]] # row_id, cluster ID
576573
arff_datacontent.append(arff_line)
@@ -579,7 +576,6 @@ def _calculate_local_measure(sklearn_fn, openml_name):
579576
raise TypeError(type(task))
580577

581578
for measure in user_defined_measures_fold:
582-
583579
if measure not in user_defined_measures_per_fold:
584580
user_defined_measures_per_fold[measure] = OrderedDict()
585581
if rep_no not in user_defined_measures_per_fold[measure]:
@@ -674,7 +670,12 @@ def _run_task_get_arffcontent_parallel_helper(
674670
sample_no,
675671
)
676672
)
677-
pred_y, proba_y, user_defined_measures_fold, trace, = extension._run_model_on_fold(
673+
(
674+
pred_y,
675+
proba_y,
676+
user_defined_measures_fold,
677+
trace,
678+
) = extension._run_model_on_fold(
678679
model=model,
679680
task=task,
680681
X_train=train_x,

openml/runs/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ class OpenMLRun(OpenMLBase):
3939
setup_string: str
4040
The setup string of the run.
4141
output_files: Dict[str, str]
42-
Specifies where each related file can be found.
42+
Specifies where each related file can be found.
4343
setup_id: int
4444
An integer representing the ID of the setup used for the run.
4545
tags: List[str]
4646
Representing the tags associated with the run.
4747
uploader: int
48-
User ID of the uploader.
48+
User ID of the uploader.
4949
uploader_name: str
5050
The name of the person who uploaded the run.
5151
evaluations: Dict
@@ -79,7 +79,7 @@ class OpenMLRun(OpenMLBase):
7979
description_text: str, optional
8080
Description text to add to the predictions file. If left None, is set to the time the arff file is generated.
8181
run_details: str, optional (default=None)
82-
Description of the run stored in the run meta-data.
82+
Description of the run stored in the run meta-data.
8383
"""
8484

8585
def __init__(

openml/runs/trace.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_selected_iteration(self, fold: int, repeat: int) -> int:
5555
The trace iteration from the given fold and repeat that was
5656
selected as the best iteration by the search procedure
5757
"""
58-
for (r, f, i) in self.trace_iterations:
58+
for r, f, i in self.trace_iterations:
5959
if r == repeat and f == fold and self.trace_iterations[(r, f, i)].selected is True:
6060
return i
6161
raise ValueError(
@@ -345,7 +345,6 @@ def trace_from_xml(cls, xml):
345345

346346
@classmethod
347347
def merge_traces(cls, traces: List["OpenMLRunTrace"]) -> "OpenMLRunTrace":
348-
349348
merged_trace = (
350349
OrderedDict()
351350
) # type: OrderedDict[Tuple[int, int, int], OpenMLTraceIteration] # noqa E501

openml/setups/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def get_setup(setup_id):
100100

101101
try:
102102
return _get_cached_setup(setup_id)
103-
except (openml.exceptions.OpenMLCacheException):
103+
except openml.exceptions.OpenMLCacheException:
104104
url_suffix = "/setup/%d" % setup_id
105105
setup_xml = openml._api_calls._perform_api_call(url_suffix, "get")
106106
with io.open(setup_file, "w", encoding="utf8") as fh:

0 commit comments

Comments
 (0)