Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikohansen committed Nov 22, 2023
1 parent f1375f4 commit f216c7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion code-postprocessing/cocopp/findfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def get_directory(directory, extract_files):
raise IOError(2, 'Some of the files cannot be extracted ' +
'from "%s". The path is too long.' % directory)

tar_file.extractall(dir_name, filter='data')
try: tar_file.extractall(dir_name, filter='data')
except TypeError: tar_file.extractall(dir_name) # Windows
# TarFile.open handles tar.gz/tgz
print(' archive extracted to folder', dir_name, '...')
directory = dir_name
Expand Down
4 changes: 2 additions & 2 deletions code-postprocessing/cocopp/pproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ class DataSet(object):
>>> def setup(infoFile):
... if not os.path.exists(infoFile):
... filename = cocopp.archives.bbob.get_one('2009/BIPOP-CMA-ES_hansen')
... tarfile.open(filename).extractall(cocopp.archives.bbob.local_data_path, filter='data')
... tarfile.open(filename).extractall(cocopp.archives.bbob.local_data_path)
>>> infoFile = os.path.join(cocopp.archives.bbob.local_data_path, 'BIPOP-CMA-ES', 'bbobexp_f2.info')
>>> print('get'); setup(infoFile) # doctest:+ELLIPSIS
get...
Expand Down Expand Up @@ -670,7 +670,7 @@ class DataSet(object):
>>> infoFile = os.path.join(cocopp.archives.bbob.local_data_path, 'BIPOP-CMA-ES', 'bbobexp_f2.info')
>>> if not os.path.exists(infoFile):
... filename = cocopp.archives.bbob.get_one('bbob/2009/BIPOP-CMA-ES_hansen')
... tarfile.open(filename).extractall(cocopp.archives.bbob.local_data_path, filter='data')
... tarfile.open(filename).extractall(cocopp.archives.bbob.local_data_path)
>>> dslist = cocopp.load(infoFile)
Data consistent according to consistency_check() in pproc.DataSet
>>> dslist[2].instancenumbers
Expand Down

0 comments on commit f216c7c

Please sign in to comment.