aboutsummaryrefslogtreecommitdiff
path: root/ccwl
AgeCommit message (Collapse)Author
2024-04-13ccwl: Restrict #:requirements parameter to YAML serializable trees.HEADmainArun Isaac
This is in keeping with the way the #:other parameter is handled. * ccwl/ccwl.scm (command, js-expression): Restrict #:requirements parameter to YAML serializable trees.
2024-03-22ccwl: Implement js-expression.Arun Isaac
js-expression corresponds to ExpressionTool in the CWL specification. * ccwl/ccwl.scm (<js-expression>): New type. (js-expression): New macro. (function-inputs, function-outputs, function-object): Support <js-expression> objects. (function-input-keys): Mention <js-expression> objects in docstring. * ccwl/cwl.scm (function->cwl, workflow->cwl-scm): Support <js-expression> objects. (command->cwl-scm): Move staging requirements handling to ... (staging-requirements): ... this new function. (js-expression->cwl, js-expression->cwl-scm): New functions. * ccwl/graphviz.scm (function->dot): Support <js-expression> objects. (command->graph): Abstract to ... (single-node-workflow->graph): ... this new function. (js-expression->dot, js-expression->graph): New functions. * scripts/ccwl (main): Support <js-expression> objects. * doc/ccwl.skb (Cookbook){Javascript expressions via ExpressionTool}: New section. * doc/js-expression-iota.scm: New file.
2024-03-22scripts: Use unified function terminology.Arun Isaac
Call workflows and commands by our unified notion of "function". This makes it more succinct when adding more kinds of functions. * ccwl/cwl.scm (workflow-or-command->cwl): Rename to function->cwl. * ccwl/graphviz.scm (workflow-or-command->dot): Rename to function->dot. * scripts/ccwl (main): Use function->cwl and function->dot.
2024-03-12ccwl: Find run argument directly without finding the position first.Arun Isaac
* ccwl/ccwl.scm (run-arg-position): Delete function. (find-run-arg): New function. (command): Use find-run-arg instead of run-arg-position.
2024-03-12ccwl: Count argument positions on flattened run arguments.Arun Isaac
* ccwl/ccwl.scm (command): Count argument positions on flattened run arguments. * tests/ccwl.scm ("count argument positions correctly when left-flanked by prefixed string arguments"): New test.
2023-12-01ccwl: Deduplicate global workflow input keys across tee branches.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Deduplicate global workflow input keys across branches of tees. * tests/ccwl.scm (key, collect-steps): New variables. ("rename should work even on the final output of a workflow"): Update order of elements in expected list. ("tee must deduplicate global workflow input keys"): New test. * ccwl/utils.scm (append-mapn): Delete function. * tests/utils.scm ("append-mapn"): Delete test.
2023-12-01ccwl: Implement identity construct.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Implement identity construct. * doc/ccwl.skb (Cookbook)[The identity construct]: New section. * doc/identity-construct.scm: New file.
2023-11-23yaml: Escape all indicator characters.Arun Isaac
* ccwl/yaml.scm (display-atom): Escape strings if they contain any indicator character.
2023-11-23ccwl: Implement item separators for array inputs.Arun Isaac
* ccwl/ccwl.scm (<input>)[separator]: New field. * ccwl/ccwl.scm (run-arg-position, run-args): Support array input specifiers. (run-arg-separator): New function. (command): Set separator on input objects. * ccwl/cwl.scm (input->cwl-scm): Serialize itemSeparator. * tests/ccwl.scm ("commands with non-string #:separator parameters must raise a &ccwl-violation condition"): New test. * doc/ccwl.skb (Cookbook)[Array input item separators]: New section. * doc/array-input-item-separators.scm: New file.
2023-11-23ccwl: Scan run-args only once when constructing inputs.Arun Isaac
* ccwl/ccwl.scm (run-arg-prefix): Operate on a specific run argument, rather than on a list of them. (command): Scan run-args only once when constructing inputs.
2023-11-23ccwl: Parse run arguments recursively.Arun Isaac
Parsing run arguments recursively allows us to share code between different pattern matchers. For example, the input matcher and the (prefix input) matcher can share code. This will come in handy as our pattern matchers grow more complex. * ccwl/ccwl.scm (run-args): Parse run arguments recursively.
2023-11-21ccwl: Comment on passing global workflow inputs through all commands.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Comment on passing global workflow inputs through all commands.
2023-11-21ccwl: Reimplement rename recursively.Arun Isaac
With recursion, we no longer need an explicit call to map, and the code is less deeply nested. This is good for clarity. * ccwl/ccwl.scm (collect-steps): Reimplement rename recursively.
2023-11-21ccwl: Report unknown keys passed to rename.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Report unknown keys passed to rename. * tests/ccwl.scm ("rename with unknown key must raise a &ccwl-violation condition"): New test.
2023-11-19ccwl: Delete code remnant from previous editing.Arun Isaac
This code remnant actually compiled successfully and was well-hidden from sight! * ccwl/ccwl.scm (key->output): Delete code remnant from previous editing.
2023-11-18ccwl: Error out if arguments have been supplied more than once.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Error out if arguments have been supplied more than once.
2023-11-18ccwl: Never set other and binding fields of inputs/outputs to #f.Arun Isaac
Setting the other and binding fields to #f is a type violation. It messes with code that expects these fields to always contain lists. * ccwl/ccwl.scm (cwl-workflow): Set other and binding fields of inputs and outputs to the empty list.
2023-11-18ccwl: Report non-existent external CWL workflow files.Arun Isaac
cwl-workflow needs to be a macro so we have access to syntax objects necessary to raise a &cwl-violation condition. * ccwl/ccwl.scm (cwl-workflow): Rewrite as macro. Report error if CWL file does not exist.
2023-11-18ccwl: Allow nested workflows in workflow body.Arun Isaac
* ccwl/ccwl.scm (function-inputs, function-outputs, function-object): Support <workflow> objects as functions. (<workflow>): Move above function-outputs. * ccwl/cwl.scm (workflow->cwl-scm): Allow nested workflows.
2023-11-18ccwl: Restrict #:binding parameter to YAML serializable trees.Arun Isaac
* ccwl/ccwl.scm (ensure-yaml-serializable): Accept parameter name for &formatted-message condition. (input): Explicitly pass parameter name #:other. Restrict #:binding parameter to YAML serializable trees. * doc/capture-output-file-with-parameter-reference.scm (extract-specific-file), doc/capture-output-file.scm (extract), doc/decompress-compile-run.scm (compile): Pass an YAML serializable tree, not an expression, as the #:binding parameter.
2023-11-17ccwl: Report errors in rename mappings.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Report errors in rename mappings.
2023-11-17utils: Define pairify behaviour on odd number of elements.Arun Isaac
* ccwl/utils.scm (pairify): Ignore extra elements when list has an odd number of elements. * tests/utils.scm ("pairify must ignore extra elements when list has an odd number of elements"): New test.
2023-11-17ccwl: Implement cross product scattering operations.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Implement scatter-cross and scatter-nested-cross. (key->output): Nest output array types for nested cross product scatters.
2023-11-17ccwl: Recreate types using syntax.Arun Isaac
* ccwl/ccwl.scm (type->syntax): New function. (key->output): Use type->syntax.
2023-11-17ui: Colorize format specifiers not format arguments.Arun Isaac
* ccwl/ui.scm (report-formatted-message): Colorize format specifiers not format arguments. * tests/ui.scm ("report-formatted-message must not fail on arguments that are not strings"): New test.
2023-11-17yaml: Serialize atomic dictionary values on the same line.Arun Isaac
* ccwl/yaml.scm (display-dictionary-entry): Serialize atomic values on the same line. * tests/yaml.scm ("dictionary keys that map to an atomic value must be serialized on the same line"): New test.
2023-11-16yaml: Comment on various cases handled by scm->yaml.Arun Isaac
* ccwl/yaml.scm (scm->yaml): Comment on cases handled.
2023-11-16yaml: Display arrays with a single atomic element on the same line.Arun Isaac
* ccwl/yaml.scm (atom?): New function. (display-dictionary-entry, scm->yaml): Display arrays with a single atomic element on the same line. * tests/yaml.scm ("strings with hyphen characters should be escaped", "strings with asterisk characters should be escaped"): Update tests with new behaviour. ("single element vectors must be serialized on the same line"): New test.
2023-11-16ccwl: Support nested arrays.Arun Isaac
* ccwl/ccwl.scm (construct-type-syntax): Construct types recursively to support nested arrays. (key->output): Recursively convert stdout types to File types. * ccwl/cwl.scm (type->cwl): New function. (input->cwl-scm, output->cwl-scm): Use type->cwl. * tests/ccwl.scm (make-array-type): New function. (construct-type-syntax-wrapper): New syntax. ("construct-type-syntax on primitive types", "construct-type-syntax on array types", "construct-type-syntax on nested array types"): New tests. * tests/cwl.scm, doc/array-types.scm, doc/nested-array-types.scm: New files. * doc/ccwl.skb (Cookbook)[Array types]: New section.
2023-11-14ccwl: Implement scatter.Arun Isaac
* ccwl/ccwl.scm (<step>): Wrap constructor make-step. [scattered-inputs, scatter-method]: New fields. (collect-scatter-step): New function. (collect-steps): Implement scatter. (key->output): If step scatters, convert output to an array type. (workflow): Add syntax to initialize scattered-inputs and scatter-method fields of <step> object. * ccwl/cwl.scm (workflow->cwl-scm): Add ScatterFeatureRequirement if workflow contains scattering steps. Serialize scattered-inputs and scatter-method. * doc/ccwl.skb (Cookbook)[Scatter/gather]: New section.
2023-11-14ccwl: Clarify that key->output is meant for workflow outputs only.Arun Isaac
* ccwl/ccwl.scm (key->output): Clarify in the docstring that this is meant for workflow outputs only.
2023-11-14ccwl: Convert stdout type outputs to File type in ccwl.scm.Arun Isaac
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.
2023-11-14ccwl: Build output from key outside of syntax.Arun Isaac
It is easier (no need to juggle complex with-syntax constructs) to do more complicated operations outside of the scope of syntax. * ccwl/ccwl.scm (key->output): Build output from key outside of syntax.
2023-11-14ccwl: Introduce syntax for array types.Arun Isaac
* ccwl/ccwl.scm (<array-type>): New type. (memoize, make-array-type, construct-type-syntax): New functions. (input, output): Use construct-type-syntax. * ccwl/cwl.scm (output->cwl-scm, input->cwl-scm): Render array types.
2023-11-07cwl: Unify rendering of command and workflow outputs.Arun Isaac
* ccwl/cwl.scm (output->cwl-scm): Handle both command and workflow outputs. Accept #:workflow? argument to indicate workflow outputs. (workflow->cwl-scm): Use output->cwl-scm.
2023-11-07cwl: Deduplicate input to CWL rendering.Arun Isaac
* ccwl/cwl.scm (input->cwl-scm): New function. (workflow->cwl-scm, command->cwl-scm): Use input->cwl-scm.
2023-11-07ccwl: Delete unused input=? function.Arun Isaac
* ccwl/ccwl.scm (input=?): Delete function.
2023-11-06ui: Do not attempt to display the line preceding the 0th.Arun Isaac
* ccwl/ui.scm (source-in-context): Do not attempt to display the line preceding the 0th. * tests/ui.scm ("display source in context on 0th line"): New line.
2023-11-06Use (term ansi-color) for colors.Arun Isaac
* build-aux/test-driver.scm (color): Use colorize-string from (term ansi-color). * ccwl/ui.scm (report-formatted-message, source-in-context, report-ccwl-violation): Use colorize-string from (term ansi-color). (color, bold, red, magenta): Delete functions.
2023-11-06ui: Pass port, not filename, to source-in-context.Arun Isaac
* ccwl/ui.scm (source-in-context): Accept port, not filename. (report-ccwl-violation): Pass port, not filename.
2023-11-06ccwl: Error out if #:other parameters are not serializable to YAML.Arun Isaac
* ccwl/ccwl.scm (ensure-yaml-serializable): New function. (input, output, command): Use ensure-yaml-serializable. * tests/ccwl.scm ("inputs with #:other parameters that fail to evaluate must raise a &ccwl-violation condition", "outputs with #:other parameters that fail to evaluate must raise a &ccwl-violation condition", "commands with #:other parameters that fail to evaluate must raise a &ccwl-violation condition"): New tests.
2023-10-28ccwl: Restrict #:other parameter to YAML serializable trees.Arun Isaac
Perhaps it fits in better with the spirit of ccwl to not evaluate #:other parameters and instead allow only YAML serializable trees. This saves users from quoting #:other parameters, of course. But it also permits more thorough analysis and clearer error messages. Besides, there is not much reason to allow general expressions in #:other parameters. Such dynamism is not commonly required in ccwl or CWL. * ccwl/ccwl.scm (input, output, command): Restrict #:other parameter to YAML serializable trees that are not evaluated.
2023-10-17ccwl: Add "Invalid parameter" to #:stderr and #:stdout error messages.Arun Isaac
* ccwl/ccwl.scm (command): Add "Invalid parameter" to #:stderr and #:stdout error messages. * tests/ccwl.scm ("commands with non-string #:stderr parameters must raise a &ccwl-violation condition", "commands with non-string #:stdout parameters must raise a &ccwl-violation condition"): Adjust tests.
2023-10-17ccwl: Support staging input files.Arun Isaac
* ccwl/ccwl.scm (<input>)[stage?]: New field. * ccwl/ccwl.scm (input): Add #:stage argument. * ccwl/cwl.scm (command->cwl-scm): Serialize requirements for staged inputs. * doc/ccwl.skb (Cookbook)[Stage input files]: New section. * tests/ccwl.scm ("inputs with an invalid #:stage? parameter must raise a &ccwl-violation condition"): New test.
2023-10-16ccwl: Add #:requirements argument to command.Arun Isaac
* ccwl/ccwl.scm (<command>)[requirements]: New field. (command): Add #:requirements argument. * ccwl/cwl.scm (command->cwl-scm): Serialize requirements.
2023-10-16ccwl: Support arbitrary expressions in #:other arguments.Arun Isaac
Support arbitrary expressions, that are actually evaluated, in #:other arguments. This means, among other things, that users will have to quote them correctly. While this complicates matters for novice users who may not be familiar with scheme, it is the most general and most flexible solution. In this particular case, we value flexibility over ease of use since #:other is an escape hatch and if users have to use it, ease of use has already been lost. * ccwl/ccwl.scm (input, output, command): Make #:other an actually evaluated unary argument.
2023-10-16ccwl: Error out on prefixes that are not strings.Arun Isaac
* ccwl/ccwl.scm (run-args): Error out on prefixes that are not strings. * tests/ccwl.scm ("command definitions with non-string prefixes in prefixed inputs must raise a &ccwl-violation condition"): New test.
2023-10-16ccwl: Flatten prefixed string arguments in command definitions.Arun Isaac
* ccwl/ccwl.scm (run-args): Flatten prefixed string arguments in command definitions. * tests/ccwl.scm ("tolerate prefixed string arguments in command definitions"): New test.
2023-10-16ccwl: Move run arguments construction to separate function.Arun Isaac
* ccwl/ccwl.scm (command): Move run arguments construction to ... (run-args): ... new function.
2023-10-16ccwl: Raise &ccwl-violation on invalid command #:run arguments.Arun Isaac
* ccwl/ccwl.scm (command): Raise &ccwl-violation on invalid command #:run arguments. * tests/ccwl.scm ("command definitions with invalid #:run arguments must raise a &ccwl-violation condition"): New test.