about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2025-11-29 02:35:40 +0000
committerArun Isaac2025-11-29 02:36:50 +0000
commitf5ce804ed0f1aaf8498177133424c10be83108d2 (patch)
treef4a7bd7344589e7b8829921209ed74693813cc08
parent524989772d8a74c8245b089135bcf24472ddc9ad (diff)
downloadravanan-f5ce804ed0f1aaf8498177133424c10be83108d2.tar.gz
ravanan-f5ce804ed0f1aaf8498177133424c10be83108d2.tar.lz
ravanan-f5ce804ed0f1aaf8498177133424c10be83108d2.zip
workflow: Let optional-input? be a true predicate.
optional-input? must be a predicate that returns #t or #f. It must not
return the id of the input.
-rw-r--r--ravanan/workflow.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/ravanan/workflow.scm b/ravanan/workflow.scm
index 1ae7f98..f3b9968 100644
--- a/ravanan/workflow.scm
+++ b/ravanan/workflow.scm
@@ -175,11 +175,10 @@ requirements and hints of the step."
 (define (optional-input? input)
   "Return @code{#t} if @var{input} is optional. Else, return @code{#f}."
   ;; Inputs that either have a default or accept null values are optional.
-  (and (or (assoc-ref input "default")
-           (match-type 'null
-                       (formal-parameter-type
-                        (assoc-ref* input "type"))))
-       (assoc-ref input "id")))
+  (or (assoc-ref input "default")
+      (match-type 'null
+                  (formal-parameter-type
+                   (assoc-ref* input "type")))))
 
 (define* (workflow->scheduler-proc name cwl scheduler
                                    manifest-file inferior scratch store
@@ -287,7 +286,9 @@ command-line-tool)}."
                                     (assoc-ref run "inputs"))
                   ;; Inputs that either have a default or accept null values are
                   ;; optional.
-                  (vector-filter-map->list optional-input?
+                  (vector-filter-map->list (lambda (input)
+                                             (and (optional-input? input)
+                                                  (assoc-ref input "id")))
                                            (assoc-ref run "inputs"))
                   (vector-map->list (lambda (output)
                                       (let ((output-id (assoc-ref output "id")))