Skip to content

Commit 9afa80b

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

26 files changed

Lines changed: 14 additions & 81 deletions

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
@@ -326,7 +326,6 @@ def _send_request(request_method, url, data, files=None, md5_checksum=None):
326326
if request_method == "get" and not __is_checksum_equal(
327327
response.text.encode("utf-8"), md5_checksum
328328
):
329-
330329
# -- Check if encoding is not UTF-8 perhaps
331330
if __is_checksum_equal(response.content, md5_checksum):
332331
raise OpenMLHashException(

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 not isinstance(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
@@ -1021,7 +1021,6 @@ def flatten_all(list_):
10211021
# when deserializing the parameter
10221022
sub_components_explicit.add(identifier)
10231023
if isinstance(sub_component, str):
1024-
10251024
external_version = self._get_external_version_string(None, {})
10261025
dependencies = self._get_dependencies()
10271026
tags = self._get_tags()
@@ -1072,7 +1071,6 @@ def flatten_all(list_):
10721071
parameters[k] = parameter_json
10731072

10741073
elif isinstance(rval, OpenMLFlow):
1075-
10761074
# A subcomponent, for example the base model in
10771075
# AdaBoostClassifier
10781076
sub_components[k] = rval
@@ -1762,7 +1760,6 @@ def _prediction_to_probabilities(
17621760
)
17631761

17641762
if isinstance(task, (OpenMLClassificationTask, OpenMLLearningCurveTask)):
1765-
17661763
try:
17671764
proba_y = model_copy.predict_proba(X_test)
17681765
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)
@@ -329,7 +327,6 @@ def get_flow_id(
329327

330328

331329
def __list_flows(api_call: str, output_format: str = "dict") -> Union[Dict, pd.DataFrame]:
332-
333330
xml_string = openml._api_calls._perform_api_call(api_call, "get")
334331
flows_dict = xmltodict.parse(xml_string, force_list=("oml:flow",))
335332

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/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
@@ -97,7 +97,7 @@ def get_setup(setup_id):
9797

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

openml/study/study.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def __init__(
7373
runs: Optional[List[int]],
7474
setups: Optional[List[int]],
7575
):
76-
7776
self.study_id = study_id
7877
self.alias = alias
7978
self.main_entity_type = main_entity_type

0 commit comments

Comments
 (0)