Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions tests/test_runs/test_run_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def _assert_predictions_equal(self, predictions, predictions_prime):
def _rerun_model_and_compare_predictions(self, run_id, model_prime, seed, create_task_obj):
run = openml.runs.get_run(run_id)

# TODO: assert holdout task


# downloads the predictions of the old task
file_id = run.output_files["predictions"]
Expand Down Expand Up @@ -341,12 +341,14 @@ def _remove_random_state(flow):
assert isinstance(run.dataset_id, int)

# This is only a smoke check right now
# TODO add a few asserts here
run._to_xml()

xml = run._to_xml()
assert isinstance(xml, str)
if run.trace is not None:
# This is only a smoke check right now
# TODO add a few asserts here
run.trace.trace_to_arff()

arff_dict = run.trace.trace_to_arff()
assert isinstance(arff_dict, dict)

# check arff output
assert len(run.data_content) == num_instances
Expand Down Expand Up @@ -394,7 +396,7 @@ def _remove_random_state(flow):

downloaded = openml.runs.get_run(run_.run_id)
assert "openml-python" in downloaded.tags

assert len(downloaded.parameter_settings) > 0
# TODO make sure that these attributes are instantiated when
# downloading a run? Or make sure that the trace object is created when
# running a flow on a task (and not only the arff object is created,
Expand Down Expand Up @@ -609,13 +611,14 @@ def determine_grid_size(param_grid):
create_task_obj=False,
)

# todo: check if runtime is present

self._check_fold_timing_evaluations(
fold_evaluations=run.fold_evaluations,
num_repeats=1,
num_folds=num_folds,
task_type=task_type,
)
assert "runtime" in run.attributes

# Check if run string and print representation do not run into an error
# The above check already verifies that all columns needed for supported
Expand Down Expand Up @@ -2099,4 +2102,4 @@ def test_joblib_backends(parallel_mock, n_jobs, backend, call_count):
# *_time_millis_* not recorded when n_jobs = -1
assert len(res[2]["predictive_accuracy"][0]) == 10
assert len(res[3]["predictive_accuracy"][0]) == 10
assert parallel_mock.call_count == call_count
assert parallel_mock.call_count == call_count