Skip to content

Commit

Permalink
Merge pull request #112 from umccr/bugfix/fix-cwl-array-input
Browse files Browse the repository at this point in the history
Fix input for cwl array
  • Loading branch information
alexiswl authored Aug 30, 2024
2 parents 5b60bed + a1f0ad8 commit 2aa14b5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/wrapica/utils/cwl_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,32 @@ def get_workflow_input_type_from_array_schema(workflow_input: WorkflowInputParam
:param workflow_input:
:return:
"""
if workflow_input.type_.items == "string":
return [
"string" if workflow_input.default is None else workflow_input.default
],
elif workflow_input.type_.items == "int":
return [
1 if workflow_input.default is None else workflow_input.default
],
elif workflow_input.type_.items == "boolean":
return [
False if workflow_input.default is None else workflow_input.default
]
elif workflow_input.type_.items == "File":
return [
{
"class": "File",
"location": "icav2://project_id/path/to/file"
}
]
elif workflow_input.type_.items == "Directory":
return [
{
"class": "Directory",
"location": "icav2://project_id/path/to/dir/"
}
]
return [
CWLSchema.load_schema_from_uri(workflow_input.type_.items).get_inputs_template()
]
Expand Down

0 comments on commit 2aa14b5

Please sign in to comment.