HIPS / Spearmint

Spearmint Bayesian optimization codebase
Other
1.55k stars 329 forks source link

parsing experiment dir fails #8

Closed lzamparo closed 10 years ago

lzamparo commented 10 years ago

Using python 2.7.8 (default, Oct 18 2014, 12:50:18) [GCC 4.9.1],

I found that os.path.realpath() does not remove the '~' character if the path is specified as (e.g) '~/path/to/experiments/':

'/home/lee/~/projects/Spearmint/examples'

I suggest that os.path.realpath() should wrap os.path.expanduser(), as in the following example.

os.path.realpath(os.path.expanduser('~/projects/Spearmint/examples/'))
'/home/lee/projects/Spearmint/examples'
os.path.realpath(os.path.expanduser('~/projects/Spearmint/examples/'))

I'll create a PR

lzamparo commented 10 years ago

Ugh, markdown ate part of my first example:

os.path.realpath('~/projects/Spearmint/examples') returns '/home/lee/~/projects/Spearmint/examples'