Skip to content

Commit 27bce90

Browse files
committed
MAINT update docstring, rename function
1 parent d744710 commit 27bce90

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

openml/runs/run.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,20 @@ def __init__(self, task_id, flow_id, dataset_id, setup_string=None,
4747
self.data_content = data_content
4848
self.model = model
4949

50-
def _generate_arff_header_dict(self):
51-
"""Generates the arff header dictionary for upload to the server.
50+
def _generate_arff_dict(self):
51+
"""Generates the arff dictionary for upload to the server.
52+
53+
Assumes that the run has been executed.
5254
5355
Returns
5456
-------
55-
arf_dict : dictionary
56-
Dictionary representation of an ARFF data format containing
57-
predictions and confidences.
57+
arf_dict : dict
58+
Dictionary representation of the ARFF file that will be uploaded.
59+
Contains predictions and information about the run environment.
5860
"""
61+
if self.data_content is None:
62+
raise ValueError('Run has not been executed.')
63+
5964
run_environment = (_get_version_information() +
6065
[time.strftime("%c")] + ['Created by run_task()'])
6166
task = get_task(self.task_id)
@@ -78,7 +83,7 @@ def publish(self):
7883
7984
Uploads the results of a run to OpenML.
8085
"""
81-
predictions = arff.dumps(self._generate_arff_header_dict())
86+
predictions = arff.dumps(self._generate_arff_dict())
8287
description_xml = self._create_description_xml()
8388
file_elements = {'predictions': ("predictions.csv", predictions),
8489
'description': ("description.xml", description_xml)}

0 commit comments

Comments
 (0)