aboutsummaryrefslogtreecommitdiff
path: root/ccwl
diff options
context:
space:
mode:
authorArun Isaac2023-11-14 16:22:32 +0000
committerArun Isaac2023-11-14 22:11:10 +0000
commitc4307f5706b84f9d56dc0432b070b5fc81e239c3 (patch)
tree8a939b8f9cb97620d8cfbd05f8e923f89d6d28b2 /ccwl
parent9af74fe933c7a58851547997dfaaa348d4c958f6 (diff)
downloadccwl-c4307f5706b84f9d56dc0432b070b5fc81e239c3.tar.gz
ccwl-c4307f5706b84f9d56dc0432b070b5fc81e239c3.tar.lz
ccwl-c4307f5706b84f9d56dc0432b070b5fc81e239c3.zip
ccwl: Convert stdout type outputs to File type in ccwl.scm.
This conversation should be in ccwl.scm, not in cwl.scm. cwl.scm should only deal with CWL serialization concerns. * ccwl/cwl.scm (output->cwl-scm): Move conversion to ... * ccwl/ccwl.scm (key->output): ... here. (<output>)[type]: Add setter.
Diffstat (limited to 'ccwl')
-rw-r--r--ccwl/ccwl.scm17
-rw-r--r--ccwl/cwl.scm15
2 files changed, 15 insertions, 17 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index e174159..47b4e5f 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -197,7 +197,7 @@ compared using @code{equal?}."
(make-output id type binding source other)
output?
(id output-id set-output-id)
- (type output-type)
+ (type output-type set-output-type)
(binding output-binding)
(source output-source set-output-source)
(other output-other))
@@ -697,11 +697,16 @@ a <key> object, in STEPS, a list of <step> objects. If no such
(function-object
(step-run step-with-output)))))
(output
- ;; Set output id and source fields from key.
- (set-output-id
- (set-output-source output-for-key
- (cwl-key-address key))
- (key-name key))))
+ (set-output-type
+ ;; Set output id and source fields from key.
+ (set-output-id
+ (set-output-source output-for-key
+ (cwl-key-address key))
+ (key-name key))
+ ;; Convert stdout type outputs to File type outputs.
+ (if (eq? (output-type output-for-key) 'stdout)
+ 'File
+ (output-type output-for-key)))))
;; Construct syntax to recreate output object.
#`(make-output
#,(with-syntax ((id (datum->syntax #f (output-id output))))
diff --git a/ccwl/cwl.scm b/ccwl/cwl.scm
index e57cc79..c61d8a8 100644
--- a/ccwl/cwl.scm
+++ b/ccwl/cwl.scm
@@ -93,17 +93,10 @@ association list."
@var{workflow?} is @code{#t}, this is a workflow output."
`(,(output-id output)
,@(or (filter-alist
- `(,@(cond
- ((array-type? (output-type output))
- `((type . ((type . array)
- (items . ,(array-type-member-type (output-type output)))))))
- ;; In workflows, convert stdout outputs to File
- ;; outputs.
- ((and workflow?
- (eq? (output-type output) 'stdout))
- `((type . File)))
- (else
- `((type . ,(output-type output)))))
+ `(,@(if (array-type? (output-type output))
+ `((type . ((type . array)
+ (items . ,(array-type-member-type (output-type output))))))
+ `((type . ,(output-type output))))
;; outputBinding is relevant only to commands, and
;; outputSource is relevant only to workflows.
,@(if workflow?