From 05c75d3e59aa15a7ea3a924f11ad12a517af0b52 Mon Sep 17 00:00:00 2001
From: Marcel Loose <loose@astron.nl>
Date: Thu, 11 Nov 2021 15:54:17 +0000
Subject: [PATCH] Give inline scripts sensible names

Some of the inline scripts (bash or python) have names like "script.py",
which is not very helpful for debugging. Renamed the scripts for those
workflows that contained either script.py or script.sh.
---
 lofar-cwl/steps/ms_concat.cwl   | 6 +++---
 steps/aoflag.cwl                | 4 ++--
 steps/compare_station_list.cwl  | 4 ++--
 steps/create_workflow_input.cwl | 6 +++---
 steps/filter_ms_group.cwl       | 4 ++--
 steps/findRefAnt_join.cwl       | 6 +++---
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/lofar-cwl/steps/ms_concat.cwl b/lofar-cwl/steps/ms_concat.cwl
index 5741e4ad..fd123f59 100644
--- a/lofar-cwl/steps/ms_concat.cwl
+++ b/lofar-cwl/steps/ms_concat.cwl
@@ -5,7 +5,7 @@ $namespaces:
 id: ms_concat
 baseCommand:
   - /bin/bash
-  - script.sh
+  - ms_concat.sh
 inputs:
   - default: 50
     id: min_length
@@ -59,7 +59,7 @@ requirements:
     listing:
       - entry: $(inputs.msin)
         writable: true
-      - entryname: script.sh
+      - entryname: ms_concat.sh
         entry: |
           #!/bin/bash
           directories=\$(ls -d out_*)
@@ -71,4 +71,4 @@ requirements:
     inplaceUpdate: true
   - class: InlineJavascriptRequirement
 stdout: ms_concat.log
-stderr: ms_concat_err.log
\ No newline at end of file
+stderr: ms_concat_err.log
diff --git a/steps/aoflag.cwl b/steps/aoflag.cwl
index c2b3ec13..b6865696 100644
--- a/steps/aoflag.cwl
+++ b/steps/aoflag.cwl
@@ -11,7 +11,7 @@ hints:
 baseCommand:
 #  - aoflagger
   - /bin/bash
-  - script.sh
+  - aoflag.sh
 inputs:
   - id: msin
     type: Directory[]
@@ -132,7 +132,7 @@ requirements:
         writable: true
       - entry: $(inputs.concat_additional_ms)
         writable: true
-      - entryname: script.sh
+      - entryname: aoflag.sh
         entry: |
           #!/bin/bash
           directories=\$(ls -d out*)
diff --git a/steps/compare_station_list.cwl b/steps/compare_station_list.cwl
index 6d68fef7..4d3776bf 100644
--- a/steps/compare_station_list.cwl
+++ b/steps/compare_station_list.cwl
@@ -5,7 +5,7 @@ $namespaces:
 id: compare_station_list
 baseCommand:
   - python3
-  - script.py
+  - compare_station_list.py
 inputs:
     - id: msin
       type: Directory[]
@@ -27,7 +27,7 @@ requirements:
   - class: InlineJavascriptRequirement
   - class: InitialWorkDirRequirement
     listing:
-      - entryname: script.py
+      - entryname: compare_station_list.py
         entry: |
           import sys
           import json
diff --git a/steps/create_workflow_input.cwl b/steps/create_workflow_input.cwl
index 10b25bc5..4acf8f1b 100644
--- a/steps/create_workflow_input.cwl
+++ b/steps/create_workflow_input.cwl
@@ -18,12 +18,12 @@ outputs:
       
 baseCommand: 
   - python3
-  - script.py
+  - create_workflow_input.py
 doc: ''
 requirements:
   InitialWorkDirRequirement:
     listing:
-      - entryname: script.py
+      - entryname: create_workflow_input.py
         entry: | 
           #!/usr/bin/env python3
           
@@ -39,4 +39,4 @@ requirements:
               rendered_leafs.append(rendered_leaf)  
             
           with open('workflow_input.json', 'w') as fp:
-              json.dump({'msin': rendered_leafs}, fp, indent=4)
\ No newline at end of file
+              json.dump({'msin': rendered_leafs}, fp, indent=4)
diff --git a/steps/filter_ms_group.cwl b/steps/filter_ms_group.cwl
index bd5fbe33..2b85071a 100644
--- a/steps/filter_ms_group.cwl
+++ b/steps/filter_ms_group.cwl
@@ -5,7 +5,7 @@ baseCommand:
   - python3
 arguments:
     - position: 0
-      valueFrom: script.py
+      valueFrom: filter_ms_group.py
 inputs:
   - id: group_id
     type: string
@@ -36,7 +36,7 @@ requirements:
   - class: InlineJavascriptRequirement
   - class: InitialWorkDirRequirement
     listing:
-     - entryname: script.py
+     - entryname: filter_ms_group.py
        entry: |
         import sys
         import json
diff --git a/steps/findRefAnt_join.cwl b/steps/findRefAnt_join.cwl
index e5a3e114..734fb891 100644
--- a/steps/findRefAnt_join.cwl
+++ b/steps/findRefAnt_join.cwl
@@ -5,7 +5,7 @@ $namespaces:
 id: findRefAnt_join
 baseCommand:
   - python3
-  - script.py
+  - findRefAnt_join.py
 inputs:
     - id: flagged_fraction_dict
       type: string[]?
@@ -44,7 +44,7 @@ requirements:
     listing:
       - entryname: input.json
         entry: $(inputs.flagged_fraction_dict)
-      - entryname: script.py
+      - entryname: findRefAnt_join.py
         entry: |
             import sys
             import json
@@ -105,4 +105,4 @@ requirements:
                 json.dump(flagged_fraction_antenna, fp)
 
 stdout: findRefAnt.log
-stderr: findRefAnt_err.log
\ No newline at end of file
+stderr: findRefAnt_err.log
-- 
GitLab