From c4307f5706b84f9d56dc0432b070b5fc81e239c3 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 14 Nov 2023 16:22:32 +0000 Subject: 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. ()[type]: Add setter. --- ccwl/ccwl.scm | 17 +++++++++++------ ccwl/cwl.scm | 15 ++++----------- 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 object, in STEPS, a list of 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? -- cgit v1.2.3