Skip to content

Commit 03c9955

Browse files
committed
fix docstrings in list_datasets, some pep8
# Conflicts: # openml/datasets/functions.py
1 parent 5bd3dbd commit 03c9955

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

openml/datasets/functions.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def _list_cached_datasets():
4444
directory_name)
4545
dataset_directory_content = os.listdir(directory_name)
4646

47-
if "dataset.arff" in dataset_directory_content and \
48-
"description.xml" in dataset_directory_content:
47+
if ("dataset.arff" in dataset_directory_content and
48+
"description.xml" in dataset_directory_content):
4949
if dataset_id not in datasets:
5050
datasets.append(dataset_id)
5151

@@ -142,11 +142,11 @@ def list_datasets(offset=None, size=None, tag=None):
142142
Parameters
143143
----------
144144
offset : int, optional
145-
the number of datasets to skip, starting from the first
145+
The number of datasets to skip, starting from the first.
146146
size : int, optional
147-
the maximum datasets of tasks to show
147+
The maximum number of datasets to show.
148148
tag : str, optional
149-
the tag to include
149+
Only include datasets matching this tag.
150150
151151
Returns
152152
-------
@@ -168,7 +168,7 @@ def list_datasets(offset=None, size=None, tag=None):
168168
api_call += "/offset/%d" % int(offset)
169169

170170
if size is not None:
171-
api_call += "/limit/%d" % int(size)
171+
api_call += "/limit/%d" % int(size)
172172

173173
if tag is not None:
174174
api_call += "/tag/%s" % tag
@@ -185,7 +185,7 @@ def _list_datasets(api_call):
185185
assert type(datasets_dict['oml:data']['oml:dataset']) == list, \
186186
type(datasets_dict['oml:data'])
187187
assert datasets_dict['oml:data']['@xmlns:oml'] == \
188-
'http://openml.org/openml', datasets_dict['oml:data']['@xmlns:oml']
188+
'http://openml.org/openml', datasets_dict['oml:data']['@xmlns:oml']
189189

190190
datasets = dict()
191191
for dataset_ in datasets_dict['oml:data']['oml:dataset']:
@@ -289,7 +289,6 @@ def get_dataset(dataset_id):
289289
description = _get_dataset_description(did_cache_dir, dataset_id)
290290
arff_file = _get_dataset_arff(did_cache_dir, description)
291291
features = _get_dataset_features(did_cache_dir, dataset_id)
292-
# TODO not used yet, figure out what to do with this...
293292
qualities = _get_dataset_qualities(did_cache_dir, dataset_id)
294293
except Exception as e:
295294
_remove_dataset_cache_dir(did_cache_dir)
@@ -480,7 +479,8 @@ def _create_dataset_cache_directory(dataset_id):
480479
str
481480
Path of the created dataset cache directory.
482481
"""
483-
dataset_cache_dir = os.path.join(config.get_cache_directory(), "datasets", str(dataset_id))
482+
dataset_cache_dir = os.path.join(config.get_cache_directory(), "datasets",
483+
str(dataset_id))
484484
try:
485485
os.makedirs(dataset_cache_dir)
486486
except (OSError, IOError):

0 commit comments

Comments
 (0)