Commit 903a19a5 authored by Martino Bertoni's avatar Martino Bertoni 🌋
Browse files

added symlink and metadata generation task

parent a2705fad
Pipeline #2600 passed with stages
in 77 minutes and 29 seconds
......@@ -530,12 +530,12 @@ def main(args):
#############################################
#############################################
# TASK: Create sym links for exemplary plots
def create_exemplary_links_fn(cc, sign_ref):
# TASK: Create sym links for exemplary signatures
def create_symlinks_fn(cc, sign_ref):
# link to exmplary signatures
target_path = os.path.join(args.cc_root, "exemplary")
if not os.path.isdir(target_path):
os.mkdir(target_path)
for ds in Dataset.get(exemplary=True):
signature_path = cc.get_signature_path(sign_ref, "full", ds.code)
source_path = signature_path[:-6]
......@@ -544,12 +544,16 @@ def main(args):
os.mkdir(target_dir)
if not os.path.exists(os.path.join(target_dir, ds.code[:2])):
os.symlink(source_path, os.path.join(target_dir, ds.code[:2]))
links_task = PythonCallable(
name="exemplary_links",
python_callable=create_exemplary_links_fn,
# link to single folder for all signatures
cc.export_symlinks()
# add metadata to signatures
cc.add_sign_metadata()
symlinks_task = PythonCallable(
name="symlinks",
python_callable=create_symlinks_fn,
op_args=[cc, 'sign1'])
pp.add_task(links_task)
pp.add_task(symlinks_task)
# END TASK
#############################################
......
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