Skip to content
Snippets Groups Projects
Commit 098bce4b authored by Michael Langguth's avatar Michael Langguth
Browse files

Some further corrections in path-handling of write_metadata_to_file-method.

parent 70145de1
Branches
No related tags found
No related merge requests found
...@@ -173,11 +173,12 @@ class MetaData: ...@@ -173,11 +173,12 @@ class MetaData:
meta_dict["variables"] = {"var"+str(i+1) : self.varnames[i]} meta_dict["variables"] = {"var"+str(i+1) : self.varnames[i]}
# create directory if required # create directory if required
if not os.path.exists(self.expdir): target_dir = os.path.join(self.expdir,self.expname)
if not os.path.exists(target_dir):
print("Created experiment directory: '"+self.expdir+"'") print("Created experiment directory: '"+self.expdir+"'")
os.make_dirs(self.exp_dir,exist_ok=True) os.make_dirs(target_dir,exist_ok=True)
meta_fname = os.path.join(self.expdir,os.path.join(self.expname,"metadata.json")) meta_fname = os.path.join(target_dir,"metadata.json")
# write dictionary to file # write dictionary to file
with open(meta_fname) as js_file: with open(meta_fname) as js_file:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment