1515############################################################################
1616# Local getters/accessors to the cache directory
1717
18- def get_list_of_cached_datasets (api_connector ):
18+ def _list_cached_datasets (api_connector ):
1919 """Return list with ids of all cached datasets"""
2020 datasets = []
2121
@@ -46,20 +46,20 @@ def get_list_of_cached_datasets(api_connector):
4646 return datasets
4747
4848
49- def get_cached_datasets (api_connector ):
49+ def _get_cached_datasets (api_connector ):
5050 """Searches for all OpenML datasets in the OpenML cache dir.
5151
5252 Return a dictionary which maps dataset ids to dataset objects"""
53- dataset_list = get_list_of_cached_datasets (api_connector )
53+ dataset_list = _list_cached_datasets (api_connector )
5454 datasets = OrderedDict ()
5555
5656 for did in dataset_list :
57- datasets [did ] = get_cached_dataset (api_connector , did )
57+ datasets [did ] = _get_cached_dataset (api_connector , did )
5858
5959 return datasets
6060
6161
62- def get_cached_dataset (api_connector , did ):
62+ def _get_cached_dataset (api_connector , did ):
6363 # This code is slow...replace it with new API calls
6464 description = _get_cached_dataset_description (api_connector , did )
6565 arff_file = _get_cached_dataset_arff (api_connector , did )
@@ -103,7 +103,7 @@ def _get_cached_dataset_arff(api_connector, did):
103103 "cached" % did )
104104
105105
106- def get_dataset_list (api_connector ):
106+ def list_datasets (api_connector ):
107107 """Return a list of all dataset which are on OpenML.
108108
109109 Returns
@@ -144,7 +144,7 @@ def get_dataset_list(api_connector):
144144 return datasets
145145
146146
147- def datasets_active (api_connector , dids ):
147+ def check_datasets_active (api_connector , dids ):
148148 """Check if the dataset ids provided are active.
149149
150150 Parameters
@@ -158,7 +158,7 @@ def datasets_active(api_connector, dids):
158158 A dictionary with items {did: active}, where active is a boolean. It
159159 is set to True if the dataset is active.
160160 """
161- dataset_list = get_dataset_list (api_connector )
161+ dataset_list = list_datasets (api_connector )
162162 dids = sorted (dids )
163163 active = {}
164164
@@ -171,7 +171,7 @@ def datasets_active(api_connector, dids):
171171 dataset_list_idx = idx
172172
173173
174- def download_datasets (api_connector , dids ):
174+ def get_datasets (api_connector , dids ):
175175 """Download datasets.
176176
177177 Parameters
@@ -186,16 +186,16 @@ def download_datasets(api_connector, dids):
186186
187187 Notes
188188 -----
189- Uses :func:`download_dataset ` internally. Please read
189+ Uses :func:`get_dataset ` internally. Please read
190190 the documentation of this.
191191 """
192192 datasets = []
193193 for did in dids :
194- datasets .append (download_dataset (api_connector , did ))
194+ datasets .append (get_dataset (api_connector , did ))
195195 return datasets
196196
197197
198- def download_dataset (api_connector , did ):
198+ def get_dataset (api_connector , did ):
199199 """Download a dataset.
200200
201201 TODO: explain caching!
@@ -215,14 +215,14 @@ def download_dataset(api_connector, did):
215215 raise ValueError ("Dataset ID is neither an Integer nor can be "
216216 "cast to an Integer." )
217217
218- description = download_dataset_description (api_connector , did )
219- arff_file = download_dataset_arff (api_connector , did , description = description )
218+ description = get_dataset_description (api_connector , did )
219+ arff_file = _get_dataset_arff (api_connector , did , description = description )
220220
221221 dataset = _create_dataset_from_description (description , arff_file )
222222 return dataset
223223
224224
225- def download_dataset_description (api_connector , did ):
225+ def get_dataset_description (api_connector , did ):
226226 # TODO implement a cache for this that invalidates itself after some
227227 # time
228228 # This can be saved on disk, but cannot be cached properly, because
@@ -260,7 +260,7 @@ def download_dataset_description(api_connector, did):
260260 return description
261261
262262
263- def download_dataset_arff (api_connector , did , description = None ):
263+ def _get_dataset_arff (api_connector , did , description = None ):
264264 did_cache_dir = _create_dataset_cache_dir (api_connector , did )
265265 output_file = os .path .join (did_cache_dir , "dataset.arff" )
266266
@@ -274,7 +274,7 @@ def download_dataset_arff(api_connector, did, description=None):
274274 pass
275275
276276 if description is None :
277- description = download_dataset_description (api_connector , did )
277+ description = get_dataset_description (api_connector , did )
278278 url = description ['oml:url' ]
279279 return_code , arff_string = api_connector ._read_url (url )
280280 # TODO: it is inefficient to load the dataset in memory prior to
@@ -286,7 +286,7 @@ def download_dataset_arff(api_connector, did, description=None):
286286 return output_file
287287
288288
289- def download_dataset_features (api_connector , did ):
289+ def get_dataset_features (api_connector , did ):
290290 did_cache_dir = _create_dataset_cache_dir (api_connector , did )
291291 features_file = os .path .join (did_cache_dir , "features.xml" )
292292
@@ -316,7 +316,7 @@ def download_dataset_features(api_connector, did):
316316 return features
317317
318318
319- def download_dataset_qualities (api_connector , did ):
319+ def get_dataset_qualities (api_connector , did ):
320320 # Dataset qualities are subject to change and must be fetched every time
321321 did_cache_dir = _create_dataset_cache_dir (api_connector , did )
322322 qualities_file = os .path .join (did_cache_dir , "qualities.xml" )
0 commit comments