diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95e2a5239..79bd95d19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,20 +7,20 @@ files: | )/.*\.py$ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.3 + rev: v0.11.2 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --no-cache] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.15.0 hooks: - id: mypy additional_dependencies: - types-requests - types-python-dateutil - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.4 + rev: 0.31.3 hooks: - id: check-github-workflows files: '^github/workflows/.*\.ya?ml$' diff --git a/openml/__init__.py b/openml/__init__.py index 48d301eec..fe656f4fc 100644 --- a/openml/__init__.py +++ b/openml/__init__.py @@ -91,35 +91,35 @@ def populate_cache( __all__ = [ - "OpenMLDataset", + "OpenMLBenchmarkSuite", + "OpenMLClassificationTask", + "OpenMLClusteringTask", "OpenMLDataFeature", - "OpenMLRun", - "OpenMLSplit", + "OpenMLDataset", "OpenMLEvaluation", - "OpenMLSetup", - "OpenMLParameter", - "OpenMLTask", - "OpenMLSupervisedTask", - "OpenMLClusteringTask", + "OpenMLFlow", "OpenMLLearningCurveTask", + "OpenMLParameter", "OpenMLRegressionTask", - "OpenMLClassificationTask", - "OpenMLFlow", + "OpenMLRun", + "OpenMLSetup", + "OpenMLSplit", "OpenMLStudy", - "OpenMLBenchmarkSuite", + "OpenMLSupervisedTask", + "OpenMLTask", + "__version__", + "_api_calls", + "config", "datasets", "evaluations", "exceptions", "extensions", - "config", - "runs", "flows", - "tasks", + "runs", "setups", "study", + "tasks", "utils", - "_api_calls", - "__version__", ] # Load the scikit-learn extension by default diff --git a/openml/config.py b/openml/config.py index d838b070a..6d19c805c 100644 --- a/openml/config.py +++ b/openml/config.py @@ -254,8 +254,8 @@ def stop_using_configuration_for_example(cls) -> None: global server # noqa: PLW0603 global apikey # noqa: PLW0603 - server = cast(str, cls._last_used_server) - apikey = cast(str, cls._last_used_key) + server = cast("str", cls._last_used_server) + apikey = cast("str", cls._last_used_key) cls._start_last_called = False @@ -513,10 +513,10 @@ def overwrite_config_context(config: dict[str, Any]) -> Iterator[_Config]: __all__ = [ "get_cache_directory", + "get_config_as_dict", "set_root_cache_directory", "start_using_configuration_for_example", "stop_using_configuration_for_example", - "get_config_as_dict", ] _setup() diff --git a/openml/datasets/__init__.py b/openml/datasets/__init__.py index 480dd9576..eb0932652 100644 --- a/openml/datasets/__init__.py +++ b/openml/datasets/__init__.py @@ -17,17 +17,17 @@ ) __all__ = [ + "OpenMLDataFeature", + "OpenMLDataset", "attributes_arff_from_df", "check_datasets_active", "create_dataset", + "delete_dataset", + "edit_dataset", + "fork_dataset", "get_dataset", "get_datasets", "list_datasets", - "OpenMLDataset", - "OpenMLDataFeature", - "status_update", "list_qualities", - "edit_dataset", - "fork_dataset", - "delete_dataset", + "status_update", ] diff --git a/openml/datasets/data_feature.py b/openml/datasets/data_feature.py index 218b0066d..cd9e53592 100644 --- a/openml/datasets/data_feature.py +++ b/openml/datasets/data_feature.py @@ -51,8 +51,7 @@ def __init__( # noqa: PLR0913 if data_type == "nominal": if nominal_values is None: raise TypeError( - "Dataset features require attribute `nominal_values` for nominal " - "feature type.", + "Dataset features require attribute `nominal_values` for nominal feature type.", ) if not isinstance(nominal_values, list): diff --git a/openml/datasets/dataset.py b/openml/datasets/dataset.py index 5190ac522..1cac5edb4 100644 --- a/openml/datasets/dataset.py +++ b/openml/datasets/dataset.py @@ -448,7 +448,7 @@ def _parse_data_from_arff( # noqa: C901, PLR0912, PLR0915 data = self._get_arff(self.format) except OSError as e: logger.critical( - f"Please check that the data file {arff_file_path} is " "there and can be read.", + f"Please check that the data file {arff_file_path} is there and can be read.", ) raise e diff --git a/openml/datasets/functions.py b/openml/datasets/functions.py index 3f3c709f9..87d7b3c81 100644 --- a/openml/datasets/functions.py +++ b/openml/datasets/functions.py @@ -72,7 +72,7 @@ def list_qualities() -> list[str]: raise ValueError('Error in return XML, does not contain "oml:data_qualities_list"') if not isinstance(qualities["oml:data_qualities_list"]["oml:quality"], list): - raise TypeError("Error in return XML, does not contain " '"oml:quality" as a list') + raise TypeError('Error in return XML, does not contain "oml:quality" as a list') return qualities["oml:data_qualities_list"]["oml:quality"] @@ -177,7 +177,7 @@ def list_datasets( """ if output_format not in ["dataframe", "dict"]: raise ValueError( - "Invalid output format selected. " "Only 'dict' or 'dataframe' applicable.", + "Invalid output format selected. Only 'dict' or 'dataframe' applicable.", ) # TODO: [0.15] diff --git a/openml/evaluations/__init__.py b/openml/evaluations/__init__.py index dbff47037..b56d0c2d5 100644 --- a/openml/evaluations/__init__.py +++ b/openml/evaluations/__init__.py @@ -5,7 +5,7 @@ __all__ = [ "OpenMLEvaluation", - "list_evaluations", "list_evaluation_measures", + "list_evaluations", "list_evaluations_setups", ] diff --git a/openml/evaluations/evaluation.py b/openml/evaluations/evaluation.py index 3cf732f25..c6aa4773d 100644 --- a/openml/evaluations/evaluation.py +++ b/openml/evaluations/evaluation.py @@ -103,7 +103,7 @@ def __repr__(self) -> str: "Run ID", "OpenML Run URL", "Task ID", - "OpenML Task URL" "Flow ID", + "OpenML Task URLFlow ID", "OpenML Flow URL", "Setup ID", "Data ID", diff --git a/openml/evaluations/functions.py b/openml/evaluations/functions.py index a39096a58..0aefa5090 100644 --- a/openml/evaluations/functions.py +++ b/openml/evaluations/functions.py @@ -234,7 +234,7 @@ def __list_evaluations( # Minimalistic check if the XML is useful if "oml:evaluations" not in evals_dict: raise ValueError( - "Error in return XML, does not contain " f'"oml:evaluations": {evals_dict!s}', + f'Error in return XML, does not contain "oml:evaluations": {evals_dict!s}', ) assert isinstance(evals_dict["oml:evaluations"]["oml:evaluation"], list), type( @@ -321,9 +321,9 @@ def list_evaluation_measures() -> list[str]: qualities = xmltodict.parse(xml_string, force_list=("oml:measures")) # Minimalistic check if the XML is useful if "oml:evaluation_measures" not in qualities: - raise ValueError("Error in return XML, does not contain " '"oml:evaluation_measures"') + raise ValueError('Error in return XML, does not contain "oml:evaluation_measures"') if not isinstance(qualities["oml:evaluation_measures"]["oml:measures"][0]["oml:measure"], list): - raise TypeError("Error in return XML, does not contain " '"oml:measure" as a list') + raise TypeError('Error in return XML, does not contain "oml:measure" as a list') return qualities["oml:evaluation_measures"]["oml:measures"][0]["oml:measure"] @@ -343,13 +343,13 @@ def list_estimation_procedures() -> list[str]: # Minimalistic check if the XML is useful if "oml:estimationprocedures" not in api_results: - raise ValueError("Error in return XML, does not contain " '"oml:estimationprocedures"') + raise ValueError('Error in return XML, does not contain "oml:estimationprocedures"') if "oml:estimationprocedure" not in api_results["oml:estimationprocedures"]: - raise ValueError("Error in return XML, does not contain " '"oml:estimationprocedure"') + raise ValueError('Error in return XML, does not contain "oml:estimationprocedure"') if not isinstance(api_results["oml:estimationprocedures"]["oml:estimationprocedure"], list): raise TypeError( - "Error in return XML, does not contain " '"oml:estimationprocedure" as a list', + 'Error in return XML, does not contain "oml:estimationprocedure" as a list', ) return [ @@ -415,7 +415,7 @@ def list_evaluations_setups( """ if parameters_in_separate_columns and (flows is None or len(flows) != 1): raise ValueError( - "Can set parameters_in_separate_columns to true " "only for single flow_id", + "Can set parameters_in_separate_columns to true only for single flow_id", ) # List evaluations diff --git a/openml/extensions/__init__.py b/openml/extensions/__init__.py index b49865e0e..40d3443d3 100644 --- a/openml/extensions/__init__.py +++ b/openml/extensions/__init__.py @@ -10,7 +10,7 @@ __all__ = [ "Extension", - "register_extension", - "get_extension_by_model", "get_extension_by_flow", + "get_extension_by_model", + "register_extension", ] diff --git a/openml/extensions/sklearn/extension.py b/openml/extensions/sklearn/extension.py index 2d40d03b8..b68f6b6c3 100644 --- a/openml/extensions/sklearn/extension.py +++ b/openml/extensions/sklearn/extension.py @@ -1254,8 +1254,7 @@ def _check_dependencies( else: raise NotImplementedError(f"operation '{operation}' is not supported") message = ( - "Trying to deserialize a model with dependency " - f"{dependency_string} not satisfied." + f"Trying to deserialize a model with dependency {dependency_string} not satisfied." ) if not check: if strict_version: @@ -1497,7 +1496,7 @@ def _prevent_optimize_n_jobs(self, model): ) if len(n_jobs_vals) > 0: raise PyOpenMLError( - "openml-python should not be used to " "optimize the n_jobs parameter.", + "openml-python should not be used to optimize the n_jobs parameter.", ) ################################################################################################ @@ -1555,7 +1554,7 @@ def _seed_current_object(current_value): if current_value is not None: raise ValueError( - "Models should be seeded with int or None (this should never " "happen). ", + "Models should be seeded with int or None (this should never happen). ", ) return True @@ -1780,10 +1779,10 @@ def _prediction_to_probabilities( # to handle the case when dataset is numpy and categories are encoded # however the class labels stored in task are still categories if isinstance(y_train, np.ndarray) and isinstance( - cast(List, task.class_labels)[0], + cast("List", task.class_labels)[0], str, ): - model_classes = [cast(List[str], task.class_labels)[i] for i in model_classes] + model_classes = [cast("List[str]", task.class_labels)[i] for i in model_classes] modelpredict_start_cputime = time.process_time() modelpredict_start_walltime = time.time() @@ -2006,7 +2005,7 @@ def is_subcomponent_specification(values): # (mixed)). OpenML replaces the subcomponent by an # OpenMLFlow object. if len(subcomponent) < 2 or len(subcomponent) > 3: - raise ValueError("Component reference should be " "size {2,3}. ") + raise ValueError("Component reference should be size {2,3}. ") subcomponent_identifier = subcomponent[0] subcomponent_flow = subcomponent[1] diff --git a/openml/flows/__init__.py b/openml/flows/__init__.py index ce32fec7d..d455249de 100644 --- a/openml/flows/__init__.py +++ b/openml/flows/__init__.py @@ -12,10 +12,10 @@ __all__ = [ "OpenMLFlow", - "get_flow", - "list_flows", - "get_flow_id", - "flow_exists", "assert_flows_equal", "delete_flow", + "flow_exists", + "get_flow", + "get_flow_id", + "list_flows", ] diff --git a/openml/flows/flow.py b/openml/flows/flow.py index a3ff50ca1..4d739230d 100644 --- a/openml/flows/flow.py +++ b/openml/flows/flow.py @@ -438,7 +438,7 @@ def publish(self, raise_error_if_exists: bool = False) -> OpenMLFlow: # noqa: F if not flow_id: if self.flow_id: raise openml.exceptions.PyOpenMLError( - "Flow does not exist on the server, " "but 'flow.flow_id' is not None.", + "Flow does not exist on the server, but 'flow.flow_id' is not None.", ) super().publish() assert self.flow_id is not None # for mypy @@ -448,7 +448,7 @@ def publish(self, raise_error_if_exists: bool = False) -> OpenMLFlow: # noqa: F raise openml.exceptions.PyOpenMLError(error_message) elif self.flow_id is not None and self.flow_id != flow_id: raise openml.exceptions.PyOpenMLError( - "Local flow_id does not match server flow_id: " f"'{self.flow_id}' vs '{flow_id}'", + f"Local flow_id does not match server flow_id: '{self.flow_id}' vs '{flow_id}'", ) flow = openml.flows.functions.get_flow(flow_id) @@ -520,7 +520,7 @@ def get_subflow(self, structure: list[str]) -> OpenMLFlow: sub_identifier = structure[0] if sub_identifier not in self.components: raise ValueError( - f"Flow {self.name} does not contain component with " f"identifier {sub_identifier}", + f"Flow {self.name} does not contain component with identifier {sub_identifier}", ) if len(structure) == 1: return self.components[sub_identifier] # type: ignore diff --git a/openml/flows/functions.py b/openml/flows/functions.py index 3d056ac60..c03b6a238 100644 --- a/openml/flows/functions.py +++ b/openml/flows/functions.py @@ -67,7 +67,7 @@ def _get_cached_flow(fid: int) -> OpenMLFlow: return _create_flow_from_xml(fh.read()) except OSError as e: openml.utils._remove_cache_dir_for_id(FLOWS_CACHE_DIR_NAME, fid_cache_dir) - raise OpenMLCacheException("Flow file for fid %d not " "cached" % fid) from e + raise OpenMLCacheException("Flow file for fid %d not cached" % fid) from e @openml.utils.thread_safe_if_oslo_installed @@ -217,7 +217,7 @@ def list_flows( """ if output_format not in ["dataframe", "dict"]: raise ValueError( - "Invalid output format selected. " "Only 'dict' or 'dataframe' applicable.", + "Invalid output format selected. Only 'dict' or 'dataframe' applicable.", ) # TODO: [0.15] @@ -514,11 +514,11 @@ def assert_flows_equal( # noqa: C901, PLR0912, PLR0913, PLR0915 for name in set(attr1.keys()).union(attr2.keys()): if name not in attr1: raise ValueError( - f"Component {name} only available in " "argument2, but not in argument1.", + f"Component {name} only available in argument2, but not in argument1.", ) if name not in attr2: raise ValueError( - f"Component {name} only available in " "argument2, but not in argument1.", + f"Component {name} only available in argument2, but not in argument1.", ) assert_flows_equal( attr1[name], @@ -547,9 +547,9 @@ def assert_flows_equal( # noqa: C901, PLR0912, PLR0913, PLR0915 ) if ignore_parameter_values_on_older_children: - assert ( - flow1.upload_date is not None - ), "Flow1 has no upload date that allows us to compare age of children." + assert flow1.upload_date is not None, ( + "Flow1 has no upload date that allows us to compare age of children." + ) upload_date_current_flow = dateutil.parser.parse(flow1.upload_date) upload_date_parent_flow = dateutil.parser.parse( ignore_parameter_values_on_older_children, @@ -579,7 +579,7 @@ def assert_flows_equal( # noqa: C901, PLR0912, PLR0913, PLR0915 params2 = set(flow2.parameters_meta_info) if params1 != params2: raise ValueError( - "Parameter list in meta info for parameters differ " "in the two flows.", + "Parameter list in meta info for parameters differ in the two flows.", ) # iterating over the parameter's meta info list for param in params1: diff --git a/openml/runs/__init__.py b/openml/runs/__init__.py index 6d3dca504..2f068a2e6 100644 --- a/openml/runs/__init__.py +++ b/openml/runs/__init__.py @@ -19,14 +19,14 @@ "OpenMLRun", "OpenMLRunTrace", "OpenMLTraceIteration", - "run_model_on_task", - "run_flow_on_task", + "delete_run", "get_run", - "list_runs", - "get_runs", "get_run_trace", - "run_exists", + "get_runs", "initialize_model_from_run", "initialize_model_from_trace", - "delete_run", + "list_runs", + "run_exists", + "run_flow_on_task", + "run_model_on_task", ] diff --git a/openml/runs/functions.py b/openml/runs/functions.py index b6f950020..4a226c94b 100644 --- a/openml/runs/functions.py +++ b/openml/runs/functions.py @@ -259,8 +259,7 @@ def run_flow_on_task( # noqa: C901, PLR0912, PLR0915, PLR0913 if isinstance(flow.flow_id, int) and flow_id != flow.flow_id: if flow_id is not False: raise PyOpenMLError( - "Local flow_id does not match server flow_id: " - f"'{flow.flow_id}' vs '{flow_id}'", + f"Local flow_id does not match server flow_id: '{flow.flow_id}' vs '{flow_id}'", ) raise PyOpenMLError( "Flow does not exist on the server, but 'flow.flow_id' is not None." @@ -292,8 +291,7 @@ def run_flow_on_task( # noqa: C901, PLR0912, PLR0915, PLR0913 if flow.extension.check_if_model_fitted(flow.model): warnings.warn( - "The model is already fitted!" - " This might cause inconsistency in comparison of results.", + "The model is already fitted! This might cause inconsistency in comparison of results.", RuntimeWarning, stacklevel=2, ) @@ -888,7 +886,7 @@ def obtain_field(xml_obj, fieldname, from_server, cast=None): # type: ignore if not from_server: return None - raise AttributeError("Run XML does not contain required (server) " "field: ", fieldname) + raise AttributeError("Run XML does not contain required (server) field: ", fieldname) run = xmltodict.parse(xml, force_list=["oml:file", "oml:evaluation", "oml:parameter_setting"])[ "oml:run" @@ -948,7 +946,7 @@ def obtain_field(xml_obj, fieldname, from_server, cast=None): # type: ignore sample_evaluations: dict[str, dict[int, dict[int, dict[int, float | Any]]]] = {} if "oml:output_data" not in run: if from_server: - raise ValueError("Run does not contain output_data " "(OpenML server error?)") + raise ValueError("Run does not contain output_data (OpenML server error?)") predictions_url = None else: output_data = run["oml:output_data"] @@ -1000,7 +998,7 @@ def obtain_field(xml_obj, fieldname, from_server, cast=None): # type: ignore evaluations[key] = value if "description" not in files and from_server is True: - raise ValueError("No description file for run %d in run " "description XML" % run_id) + raise ValueError("No description file for run %d in run description XML" % run_id) if "predictions" not in files and from_server is True: task = openml.tasks.get_task(task_id) diff --git a/openml/runs/run.py b/openml/runs/run.py index 945264131..2effe0c79 100644 --- a/openml/runs/run.py +++ b/openml/runs/run.py @@ -365,7 +365,7 @@ def to_filesystem( model. """ if self.data_content is None or self.model is None: - raise ValueError("Run should have been executed (and contain " "model / predictions)") + raise ValueError("Run should have been executed (and contain model / predictions)") directory = Path(directory) directory.mkdir(exist_ok=True, parents=True) @@ -517,7 +517,7 @@ def get_metric_fn(self, sklearn_fn: Callable, kwargs: dict | None = None) -> np. # TODO: make this a stream reader else: raise ValueError( - "Run should have been locally executed or " "contain outputfile reference.", + "Run should have been locally executed or contain outputfile reference.", ) # Need to know more about the task to compute scores correctly @@ -528,11 +528,11 @@ def get_metric_fn(self, sklearn_fn: Callable, kwargs: dict | None = None) -> np. task.task_type_id in [TaskType.SUPERVISED_CLASSIFICATION, TaskType.LEARNING_CURVE] and "correct" not in attribute_names ): - raise ValueError('Attribute "correct" should be set for ' "classification task runs") + raise ValueError('Attribute "correct" should be set for classification task runs') if task.task_type_id == TaskType.SUPERVISED_REGRESSION and "truth" not in attribute_names: - raise ValueError('Attribute "truth" should be set for ' "regression task runs") + raise ValueError('Attribute "truth" should be set for regression task runs') if task.task_type_id != TaskType.CLUSTERING and "prediction" not in attribute_names: - raise ValueError('Attribute "predict" should be set for ' "supervised task runs") + raise ValueError('Attribute "predict" should be set for supervised task runs') def _attribute_list_to_dict(attribute_list): # type: ignore # convenience function: Creates a mapping to map from the name of @@ -566,7 +566,7 @@ def _attribute_list_to_dict(attribute_list): # type: ignore pred = predictions_arff["attributes"][predicted_idx][1] corr = predictions_arff["attributes"][correct_idx][1] raise ValueError( - "Predicted and Correct do not have equal values:" f" {pred!s} Vs. {corr!s}", + f"Predicted and Correct do not have equal values: {pred!s} Vs. {corr!s}", ) # TODO: these could be cached diff --git a/openml/runs/trace.py b/openml/runs/trace.py index bc9e1b5d6..87fccf5e5 100644 --- a/openml/runs/trace.py +++ b/openml/runs/trace.py @@ -185,8 +185,7 @@ def generate( raise ValueError("Trace content is empty.") if len(attributes) != len(content[0]): raise ValueError( - "Trace_attributes and trace_content not compatible:" - f" {attributes} vs {content[0]}", + f"Trace_attributes and trace_content not compatible: {attributes} vs {content[0]}", ) return cls._trace_from_arff_struct( diff --git a/openml/setups/__init__.py b/openml/setups/__init__.py index dd38cb9b7..fa4072059 100644 --- a/openml/setups/__init__.py +++ b/openml/setups/__init__.py @@ -4,10 +4,10 @@ from .setup import OpenMLParameter, OpenMLSetup __all__ = [ - "OpenMLSetup", "OpenMLParameter", + "OpenMLSetup", "get_setup", + "initialize_model", "list_setups", "setup_exists", - "initialize_model", ] diff --git a/openml/setups/functions.py b/openml/setups/functions.py index 877384636..22a236dfa 100644 --- a/openml/setups/functions.py +++ b/openml/setups/functions.py @@ -157,7 +157,7 @@ def list_setups( # noqa: PLR0913 """ if output_format not in ["dataframe", "dict", "object"]: raise ValueError( - "Invalid output format selected. " "Only 'dict', 'object', or 'dataframe' applicable.", + "Invalid output format selected. Only 'dict', 'object', or 'dataframe' applicable.", ) # TODO: [0.15] @@ -230,12 +230,12 @@ def __list_setups( # Minimalistic check if the XML is useful if "oml:setups" not in setups_dict: raise ValueError( - 'Error in return XML, does not contain "oml:setups":' f" {setups_dict!s}", + f'Error in return XML, does not contain "oml:setups": {setups_dict!s}', ) if "@xmlns:oml" not in setups_dict["oml:setups"]: raise ValueError( - "Error in return XML, does not contain " f'"oml:setups"/@xmlns:oml: {setups_dict!s}', + f'Error in return XML, does not contain "oml:setups"/@xmlns:oml: {setups_dict!s}', ) if setups_dict["oml:setups"]["@xmlns:oml"] != openml_uri: @@ -364,8 +364,7 @@ def _create_setup_from_xml( ) else: raise ValueError( - "Expected None, list or dict, received " - f"something else: {type(xml_parameters)!s}", + f"Expected None, list or dict, received something else: {type(xml_parameters)!s}", ) if _output_format in ["dataframe", "dict"]: diff --git a/openml/study/__init__.py b/openml/study/__init__.py index b7d77fec4..37a6d376a 100644 --- a/openml/study/__init__.py +++ b/openml/study/__init__.py @@ -19,8 +19,8 @@ from .study import OpenMLBenchmarkSuite, OpenMLStudy __all__ = [ - "OpenMLStudy", "OpenMLBenchmarkSuite", + "OpenMLStudy", "attach_to_study", "attach_to_suite", "create_benchmark_suite", @@ -33,6 +33,6 @@ "get_suite", "list_studies", "list_suites", - "update_suite_status", "update_study_status", + "update_suite_status", ] diff --git a/openml/study/functions.py b/openml/study/functions.py index 7fdc6f636..ca961ad50 100644 --- a/openml/study/functions.py +++ b/openml/study/functions.py @@ -298,7 +298,7 @@ def update_study_status(study_id: int, status: str) -> None: """ legal_status = {"active", "deactivated"} if status not in legal_status: - raise ValueError("Illegal status value. " f"Legal values: {legal_status}") + raise ValueError(f"Illegal status value. Legal values: {legal_status}") data = {"study_id": study_id, "status": status} # type: openml._api_calls.DATA_TYPE result_xml = openml._api_calls._perform_api_call("study/status/update", "post", data=data) result = xmltodict.parse(result_xml) @@ -504,7 +504,7 @@ def list_suites( """ if output_format not in ["dataframe", "dict"]: raise ValueError( - "Invalid output format selected. " "Only 'dict' or 'dataframe' applicable.", + "Invalid output format selected. Only 'dict' or 'dataframe' applicable.", ) # TODO: [0.15] if output_format == "dict": @@ -607,7 +607,7 @@ def list_studies( """ if output_format not in ["dataframe", "dict"]: raise ValueError( - "Invalid output format selected. " "Only 'dict' or 'dataframe' applicable.", + "Invalid output format selected. Only 'dict' or 'dataframe' applicable.", ) # TODO: [0.15] if output_format == "dict": diff --git a/openml/tasks/__init__.py b/openml/tasks/__init__.py index f6df3a8d4..34c994e3a 100644 --- a/openml/tasks/__init__.py +++ b/openml/tasks/__init__.py @@ -19,17 +19,17 @@ ) __all__ = [ - "OpenMLTask", - "OpenMLSupervisedTask", - "OpenMLClusteringTask", - "OpenMLRegressionTask", "OpenMLClassificationTask", + "OpenMLClusteringTask", "OpenMLLearningCurveTask", + "OpenMLRegressionTask", + "OpenMLSplit", + "OpenMLSupervisedTask", + "OpenMLTask", + "TaskType", "create_task", + "delete_task", "get_task", "get_tasks", "list_tasks", - "OpenMLSplit", - "TaskType", - "delete_task", ] diff --git a/openml/tasks/functions.py b/openml/tasks/functions.py index 54030422d..c73ea09dc 100644 --- a/openml/tasks/functions.py +++ b/openml/tasks/functions.py @@ -174,7 +174,7 @@ def list_tasks( """ if output_format not in ["dataframe", "dict"]: raise ValueError( - "Invalid output format selected. " "Only 'dict' or 'dataframe' applicable.", + "Invalid output format selected. Only 'dict' or 'dataframe' applicable.", ) # TODO: [0.15] if output_format == "dict": diff --git a/openml/testing.py b/openml/testing.py index 9016ff6a9..8b63a7ae5 100644 --- a/openml/testing.py +++ b/openml/testing.py @@ -348,9 +348,9 @@ def create_request_response( __all__ = [ - "TestBase", - "SimpleImputer", "CustomImputer", + "SimpleImputer", + "TestBase", "check_task_existence", "create_request_response", ]