Skip to content

Commit a6d6cfe

Browse files
committed
Fix a few flake8 issues
1 parent bfb005b commit a6d6cfe

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

openml/extensions/extension_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def _run_model_on_fold(
166166
y_train: Optional[np.ndarray] = None,
167167
X_test: Optional[Union[np.ndarray, scipy.sparse.spmatrix]] = None,
168168
) -> Tuple[np.ndarray, np.ndarray, "OrderedDict[str, float]", Optional["OpenMLRunTrace"]]:
169-
"""Run a model on a repeat,fold,subsample triplet of the task and return prediction information.
169+
"""Run a model on a repeat, fold, subsample triplet of the task.
170170
171171
Returns the data that is necessary to construct the OpenML Run object. Is used by
172172
:func:`openml.runs.run_flow_on_task`.

openml/study/study.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ def id(self) -> Optional[int]:
9999

100100
def _get_repr_body_fields(self) -> List[Tuple[str, Union[str, int, List[str]]]]:
101101
"""Collect all information to display in the __repr__ body."""
102-
fields = {
102+
fields: Dict[str, Any] = {
103103
"Name": self.name,
104104
"Status": self.status,
105105
"Main Entity Type": self.main_entity_type,
106-
} # type: Dict[str, Any]
106+
}
107107
if self.study_id is not None:
108108
fields["ID"] = self.study_id
109109
fields["Study URL"] = self.openml_url

openml/tasks/task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ def id(self) -> Optional[int]:
8282

8383
def _get_repr_body_fields(self) -> List[Tuple[str, Union[str, int, List[str]]]]:
8484
"""Collect all information to display in the __repr__ body."""
85-
fields = {
85+
fields: Dict[str, Any] = {
8686
"Task Type Description": "{}/tt/{}".format(
8787
openml.config.get_server_base_url(), self.task_type_id
8888
)
89-
} # type: Dict[str, Any]
89+
}
9090
if self.task_id is not None:
9191
fields["Task ID"] = self.task_id
9292
fields["Task URL"] = self.openml_url

openml/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ def extract_xml_tags(xml_tag_name, node, allow_none=True):
7272

7373
def _get_rest_api_type_alias(oml_object: "OpenMLBase") -> str:
7474
"""Return the alias of the openml entity as it is defined for the REST API."""
75-
rest_api_mapping = [
75+
rest_api_mapping: List[Tuple[Union[Type, Tuple], str]] = [
7676
(openml.datasets.OpenMLDataset, "data"),
7777
(openml.flows.OpenMLFlow, "flow"),
7878
(openml.tasks.OpenMLTask, "task"),
7979
(openml.runs.OpenMLRun, "run"),
8080
((openml.study.OpenMLStudy, openml.study.OpenMLBenchmarkSuite), "study"),
81-
] # type: List[Tuple[Union[Type, Tuple], str]]
81+
]
8282
_, api_type_alias = [
8383
(python_type, api_alias)
8484
for (python_type, api_alias) in rest_api_mapping

0 commit comments

Comments
 (0)