Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Prefactor3-CWL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Rafferty
Prefactor3-CWL
Commits
a79ad4cb
Commit
a79ad4cb
authored
5 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
Refactor and add File/Dir Selector
parent
e0120734
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
steps/DP3.ParsetGenerator.cwl
+84
-76
84 additions, 76 deletions
steps/DP3.ParsetGenerator.cwl
steps/FileDirSelector.cwl
+24
-0
24 additions, 0 deletions
steps/FileDirSelector.cwl
test_jobs/parset_generator_file_input.json
+22
-0
22 additions, 0 deletions
test_jobs/parset_generator_file_input.json
with
130 additions
and
76 deletions
steps/DP3.ParsetGenerator.cwl
+
84
−
76
View file @
a79ad4cb
...
@@ -82,7 +82,7 @@ outputs:
...
@@ -82,7 +82,7 @@ outputs:
doc: additional input directory
doc: additional input directory
type: Directory[]
type: Directory[]
outputBinding:
outputBinding:
outputEval: |
-
outputEval: |
${
${
var outdirs = []
var outdirs = []
for(let step in inputs.parameters_input){
for(let step in inputs.parameters_input){
...
@@ -96,23 +96,29 @@ outputs:
...
@@ -96,23 +96,29 @@ outputs:
}
}
return outdirs
return outdirs
}
}
- id: output_files
- id: output_files
doc: expected output files
doc: expected output files
type: Any
type: Any
outputBinding:
outputBinding:
outputEval: |
-
outputEval: |
${
${
var out_names = {}
var out_names = {}
for(let step in inputs.parameters_input){
for(var step_idx in inputs.parameters_input){
step = inputs.parameters_input[step]
var step = inputs.parameters_input[step_idx]
var step_id = step['step_id']
var step_dirs = {}
if(!step.hasOwnProperty("output_files")) continue;
if(!Object.hasOwnProperty("output_files")) continue;
var step_files = {}
for(var index in step['output_files']){
for(var index in step['output_files']){
var file_id =
step['output_files'][
index
]
var file_id = index
var file_name = step['output_files'][file_id]
var file_name = step['output_files'][file_id]
out_nam
es[file_id] = file_name
step_fil
es[file_id] = file_name
}
}
out_names[step_id] = step_files
}
}
return out_names
return out_names
}
}
...
@@ -123,16 +129,18 @@ outputs:
...
@@ -123,16 +129,18 @@ outputs:
outputEval: |-
outputEval: |-
${
${
var out_names = {}
var out_names = {}
for(let step in inputs.parameters_input){
for(var step_idx in inputs.parameters_input){
step = inputs.parameters_input[step]
var step = inputs.parameters_input[step_idx]
var step_id = step['step_id']
if(!Object.hasOwnProperty("output_directories")) continue;
var step_dirs = {}
if(!step.hasOwnProperty("output_directories")) continue;
for(var index in step['output_directories']){
for(var index in step['output_directories']){
var file_id =
step['output_directories'][
index
]
var file_id = index
var file_name = step['output_directories'][file_id]
var file_name = step['output_directories'][file_id]
out_name
s[file_id] = file_name
step_dir
s[file_id] = file_name
}
}
out_names[step_id] = step_dirs
}
}
return out_names
return out_names
}
}
...
...
This diff is collapsed.
Click to expand it.
steps/FileDirSelector.cwl
0 → 100644
+
24
−
0
View file @
a79ad4cb
class: ExpressionTool
cwlVersion: v1.0
id: parsetselector
inputs:
- id: inputs
type: Any
doc: input files
- id: step_name
type: string
doc: 'if true selects parset_a, files_a if false selects parset_b files_b'
- id: type
type: string
outputs:
- id: output
type: [File, Directory]
expression: |
$(
{'output': inputs.inputs[step_name][type]}
)
label: ParsetSelector
requirements:
- class: InlineJavascriptRequirement
This diff is collapsed.
Click to expand it.
test_jobs/parset_generator_file_input.json
0 → 100644
+
22
−
0
View file @
a79ad4cb
{
"parameters_input"
:
[{
"step_type"
:
"averager"
,
"step_id"
:
"average"
,
"output_files"
:
{
"parmdb"
:
"fily"
},
"output_directories"
:
{
"parmdb"
:
"diry"
},
"parameters"
:
{
"timestep"
:
1
,
"freqstep"
:
1
,
"strategy"
:
{
"class"
:
"File"
,
"location"
:
"file:///etc/hostname"
,
"size"
:
0
,
"nameext"
:
""
}
}
}]
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment