Skip to content

Commit

Permalink
#99 Locate the experiment pp.yamls relative to the main yaml directo…
Browse files Browse the repository at this point in the history
…ry path
  • Loading branch information
Chris Blanton authored and Chris Blanton committed Jul 30, 2024
1 parent ac287ad commit 8aecb9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fre/pp/configure_script_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def consolidate_yamls(mainyaml,experiment, platform,target):
"""
Combine main yaml and experiment yaml into combined yamls
"""
# Retrieve the directory containing the main yaml, to use
# as an offset for the child yamls
mainyaml_dir = os.path.dirname(mainyaml)
# Path to new combined
combined=Path("combined.yaml")
# Create and write to combined yaml
Expand Down Expand Up @@ -101,7 +104,8 @@ def consolidate_yamls(mainyaml,experiment, platform,target):
with open(combined,"a") as f1:
for i in expyaml:
expname_list.append(i.split(".")[1])
with open(i,'r') as f2:
expyaml_path = os.path.join(mainyaml_dir, i)
with open(expyaml_path,'r') as f2:
f1.write(f"\n### {i.upper()} settings ###\n")
#copy expyaml into combined
shutil.copyfileobj(f2,f1)
Expand Down

0 comments on commit 8aecb9c

Please sign in to comment.