Commit 852c06ca authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[experiment] Remove use of Prefix

parent 9c96c33c
......@@ -71,11 +71,7 @@ class Storage(utils.Storage):
self.label = name
self.toolchain = os.path.join(self.toolchain_username, self.toolchain, self.version)
if isinstance(prefix, utils.Prefix):
self.prefix = prefix
else:
self.prefix = utils.Prefix(prefix)
self.prefix = prefix
path = utils.hashed_or_simple(self.prefix, 'experiments', name, suffix='.json')
path = path[:-5]
......@@ -1096,12 +1092,9 @@ class Experiment(object):
if not self.valid:
raise RuntimeError("experiment is not valid")
if isinstance(prefix, six.string_types):
prefix = utils.Prefix(prefix)
if prefix.paths[0] in self.prefix.paths:
raise RuntimeError("Cannot export experiment to the same prefix (%s in " \
"%s)" % (prefix.paths[0], self.prefix.paths))
if prefix == self.prefix:
raise RuntimeError("Cannot export experiment to the same prefix ("
"%s)" % (prefix))
self.toolchain.write(toolchain.Storage(prefix, self.toolchain.name))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment