summaryrefslogtreecommitdiff
path: root/ccwl/ccwl.scm
AgeCommit message (Collapse)Author
2021-10-18ccwl: Fix indentation and paragraph filling.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Fix indentation. (key->output): Fill paragraph.
2021-10-18ccwl: Implement rename to rename keys between steps.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Implement rename to rename keys between steps.
2021-10-18ccwl: Improve comment describing handling of single input commands.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Improve comment describing handling of single input commands. Mention that it applies only when no inputs are passed to it.
2021-10-18ccwl: Add setter for name field of <key> type.Arun Isaac
* ccwl/ccwl.scm (<key>): Add setter set-key-name.
2021-10-18ccwl: Separate ccwl key from CWL input/output id.Arun Isaac
* ccwl/ccwl.scm (<key>): Add cwl-id field. (key): Initialize cwl-id field. (key->output): Match the cwl-id of keys to the id of outputs, instead of matching the name of keys to the id of outputs. (cwl-key-address): Use the cwl-id of keys when outputting to CWL.
2021-10-11ccwl: Remove unused invoke-command function.Arun Isaac
* ccwl/ccwl.scm (invoke-command): Delete function.
2021-10-11ccwl: Factorize out CWL generation code to separate file.Arun Isaac
This factorization is required to support other compilation targets such as graphviz, bash, scheme, etc. * ccwl/cwl.scm: New file. * Makefile.am (SOURCES): Register it. * ccwl/ccwl.scm (ccwl): Export command?, command-inputs, command-outputs, command-args, command-stdin, command-other, workflow?, workflow-steps, workflow-inputs, workflow-outputs, workflow-other, input?, input-id, input-type, input-label, input-default, input-position, input-prefix, input-other, output?, output-id, output-type, output-binding, output-source, output-other, step?, step-id, step-run, step-in, step-out, unspecified-default?. (<workflow>): New type. (filter-alist): Move to cwl.scm. (make-workflow): Refactor into workflow->cwl-scm in cwl.scm. (output->cwl): Move to cwl.scm as output->cwl-scm. (command->cwl): Move to cwl.scm as command->cwl-scm. (workflow-steps): Rename to collect-steps. Clarify docstring. (workflow): Use collect-steps instead of workflow-steps. Explicitly pass empty list as other argument of make-workflow. Add TODO note to implement it properly. * scripts/ccwl.in: Import (ccwl cwl) instead of (ccwl yaml). Use workflow->cwl instead of scm->yaml. * tests/ccwl.scm ("stdin input should not have inputBinding"): Use command->cwl-scm from (ccwl cwl) instead of command->cwl from (ccwl ccwl).
2021-10-11ccwl: Remove unused write-cwl function.Arun Isaac
* ccwl/ccwl.scm: Do not export write-cwl. (write-cwl): Delete function.
2021-10-07ccwl: Pass workflow inputs through every command.Arun Isaac
We pass workflow inputs through all commands and constructs (pipe, tee, etc.). Thus, these parameters are globally visible to all steps, and are a kind of "global variable". * ccwl/ccwl.scm (workflow-steps): Pass to the output, input keys that correspond to workflow inputs.
2021-10-06ccwl: Fix the docstring of workflow-steps.Arun Isaac
Before this commit, the docstring of workflow-steps did not correctly describe its function. * ccwl/ccwl.scm (workflow-steps): Fix docstring.
2021-10-04ccwl: Quote source code in error messages.Arun Isaac
This makes it easier to distinct source code from the regular text of the error messages. * ccwl/ccwl.scm (workflow-steps): Quote source code in error messages.
2021-10-04Revert "In pipe, pass through input keys to all expressions."Arun Isaac
This reverts commit 35bcaaa67efbe9b60e69b0f7c17acc186c74e7c3. This was not such a good idea. It is better to introduce the notion of global parameters.
2021-08-17ccwl: Define output objects using a macro instead of a function.Arun Isaac
This allows us to do sophisticated syntax checking at an early stage, very close to the user interface. That way error messages from ccwl will make a lot more sense. * ccwl/ccwl.scm (output): Re-implement as macro. (command): Use the new macro interface. * doc/capture-output-file-with-parameter-reference.scm, doc/capture-output-file.scm, doc/capture-stdout.scm, doc/checksum.scm, doc/decompress-compile-run.scm: Use new quoting syntax for output types.
2021-08-16ccwl: Define input objects using a macro instead of a function.Arun Isaac
This allows us to do sophisticated syntax checking at an early stage, very close to the user interface. That way error messages from ccwl will make a lot more sense. * ccwl/ccwl.scm (input): Re-implement as macro. (<input>): Add new functional setters set-input-position and set-input-prefix. (input-spec-id, run-arg-position, run-arg-prefix): New functions. (command, workflow): Use the new macro interface. * doc/capture-output-file-with-parameter-reference.scm, doc/capture-output-file.scm, doc/capture-stdout.scm, doc/checksum.scm, doc/decompress-compile-run.scm, doc/hello-world.scm, doc/pass-stdin.scm: Use new quoting syntax for input types.
2021-07-27ccwl: Make syntax-lambda** more like lambda**.Arun Isaac
I have tripped up several times on the differences between lambda** and syntax-lambda**. No longer! Making syntax-lambda** as close as possible to lambda** makes the code much more readable and align better with common sense. * ccwl/utils.scm (syntax-lambda**): Do not ignore the first identifier. Accept multiple values as arguments, not a single syntax object. * ccwl/ccwl.scm (command): Update use of syntax-lambda**. * tests/utils.scm ("syntax-lambda**", "syntax-lambda** with default values"): Update tests.
2021-07-20ccwl: Do not specify '() as the default value for n-ary arguments.Arun Isaac
Specifying '() as the default value for n-ary arguments is now equivalent to specifying '(()) as the default value. This is wrong. * ccwl/ccwl.scm (command): Do not explicitly specify the emtpy list as the default value for n-ary arguments.
2021-07-05ccwl: Remove extra blank lines.Arun Isaac
* ccwl/ccwl.scm: Remove extra blank lines.
2021-06-29ccwl: Return #f if alist is empty after filtering.Arun Isaac
This way, filter-alist composes better with other invocations of filter-alist. * ccwl/ccwl.scm (filter-alist): Return #f if alist is empty after filtering. (command->cwl): Remove FIXME note about the inputBinding dictionary being empty.
2021-06-28ccwl: Import (srfi srfi-2).Arun Isaac
* ccwl/ccwl.scm: Import (srfi srfi-2).
2021-06-01Do not export obsolete functions.Arun Isaac
* ccwl/ccwl.scm: Do not export step and pipeline.
2021-06-01Introduce new command definition syntax.Arun Isaac
* ccwl/ccwl.scm: Do not export input and output. (<input>): Delete source field. Add position field. (input): Accept position and prefix fields in constructor. Do not initialize non-existent source field. (<command>): Delete additional-inputs field. Add inputs field. Delete set-command-outputs and set-command-stdin setters. (command): Rewrite as macro that accepts new command definition syntax. (<cli-element>): Delete type. (command->cwl): Generate CWL from new <command> type. (command-input-keys): Simplify to support new <command> type.
2021-06-01Remove unused setters, appenders, etc.Arun Isaac
* ccwl/ccwl.scm: Do not export input-with-prefix. (<input>): Delete set-input-prefix. (<step>): Delete set-step-run, set-step-id, set-step-out. (input-with-prefix, field-appender, modify-step-run, append-step-in, append-step-out, append-command-outputs): Delete functions.
2021-06-01In pipe, pass through input keys to all expressions.Arun Isaac
Earlier, the input keys would only be passed to the first expression. The second expression would only receive the output keys from the first expression. Passing input keys through to all expressions is a common use case, since expressions often need to access global inputs. If the original behavior is desired, we can always introduce a new construct, say `pipe-strict'. * ccwl/ccwl.scm (workflow-steps): In pipe, pass through input keys to all expressions.
2021-06-01Filter out global workflow inputs from workflow outputs.Arun Isaac
* ccwl/ccwl.scm (key->output): New function. (workflow-steps): Filter out global workflow inputs from workflow-outputs.
2021-05-23Unify command variable reference.Arun Isaac
* ccwl/ccwl.scm (command-variable, command-syntax->object): Delete functions. (command-object): New function. (workflow-steps): Use command-object instead of command-variable and command-syntax->object.
2021-05-17Support simpler syntax for inputs with no properties.Arun Isaac
* ccwl/ccwl.scm (workflow): When input has no properties, support only specifying the symbol.
2021-05-17Support implicit key pairing.Arun Isaac
* ccwl/ccwl.scm (command-syntax->object): When command accepts only a single input and there is only a single key available, support implicit key pairing.
2021-05-17Support commands with implicit step identifier.Arun Isaac
* ccwl/ccwl.scm (workflow-steps): When command does not specify step identifier, assume the step identifier is the same as the command symbol.
2021-05-17Abstract out command variable reflection.Arun Isaac
* ccwl/ccwl.scm (command-variable, command-syntax->object): New functions. (workflow-steps): Use command-variable and command-syntax->object.
2021-05-17Remove deprecated %stdin and %stdout variables.Arun Isaac
* ccwl/ccwl.scm (%stdin, %stdout): Delete variables.
2021-05-17Support general DAG workflows.Arun Isaac
* ccwl/ccwl.scm: Import (srfi srfi-71). (command-input-keys, workflow-steps): New function. (workflow): Support general Directed Acyclic Graph (DAG) workflows.
2021-05-15Implement <key> type and utilities.Arun Isaac
* ccwl/ccwl.scm (<key>): New type. (key, cwl-key-address): New functions.
2021-05-15Pass inputs explicitly to make-workflow.Arun Isaac
* ccwl/ccwl.scm (make-workflow): Accept inputs explicitly.
2021-05-15Use symbols as input identifiers instead of strings.Arun Isaac
* ccwl/ccwl.scm (input=?): Compare using eq? instead of string=?. (command->cwl, write-cwl): Convert input-id to string before appending.
2021-05-15Make stdin a unary key of command.Arun Isaac
* ccwl/ccwl.scm (command): Make stdin a unary key.
2021-05-15Do not convert YAML symbols from kebab case to camel case.Arun Isaac
Doing this conversion effectively forbids kebab case symbols in YAML. * ccwl/yaml.scm (kebab->camel): Delete function. (display-atom): Do not convert symbols from kebab case to camel case. * ccwl/ccwl.scm (make-workflow, output->cwl, command->cwl): Write camel case explicitly.
2021-04-26Remove deprecated pipeline function.Arun Isaac
* ccwl/ccwl.scm (pipeline): Delete function.
2021-04-26Redefine command using lambda**.Arun Isaac
* ccwl/ccwl.scm (command): Redefine using lambda**.
2021-04-26Implement the CCWL embedded domain specific language.Arun Isaac
* ccwl/ccwl.scm: Import (ccwl utils). (command): Return <command> object. (auto-connect): Delete function. (invoke-command, make-workflow, workflow-steps): New functions. (workflow): Replace function with macro.
2021-04-26Add setter for source field of <output> type.Arun Isaac
* ccwl/ccwl.scm (<output>): Add functional setter set-output-source for source field. * .dir-locals.el (scheme-mode): Specify indentation for set-output-source.
2021-04-25Upgrade to CWL version 1.2.Arun Isaac
Version 1.2 of the CWL specification is required to support conditional steps. * ccwl/ccwl.scm (%cwl-version): Set to "v1.2".
2021-04-17Expand name Arun I to Arun Isaac.Arun Isaac
* ccwl/ccwl.scm, ccwl/utils.scm, ccwl/yaml.scm: Expand name Arun I to Arun Isaac.
2021-04-16Add copyright and commentary sections to files.Arun Isaac
* ccwl/ccwl.scm, ccwl/utils.scm, ccwl/yaml.scm: Add copyright and commentary sections.
2021-03-22List additional-inputs while generating CWL.Arun Isaac
* ccwl/ccwl.scm (command->cwl): List additional-inputs in inputs array.
2021-03-22Add additional-inputs field to <command> type.Arun Isaac
* ccwl/ccwl.scm (<command>): Add additional-inputs field. (command): Initialize additional-inputs field.
2021-03-22Remove input->tree abstraction.Arun Isaac
<input> objects need to be expanded into CWL in context sensitive ways. There is no simple generalization. * ccwl/ccwl.scm (input->tree): Delete function. (workflow): Expand input->tree.
2021-03-22Delete input field of <command> object.Arun Isaac
* ccwl/ccwl.scm (<command>): Delete input field. (command): Do not set inputs field.
2021-03-21Print steps enclosing <command> objects correctly.Arun Isaac
* ccwl/ccwl.scm (write-cwl): Invoke command->cwl if step encloses <command> object.
2021-03-21Use both CWL arguments and inputs arrays.Arun Isaac
* ccwl/ccwl.scm (<cli-element>): New type. (command->cwl): Put string and expression arguments into the arguments array. Put <input> arguments into the inputs array.
2021-03-21Add alist filtering utility function.Arun Isaac
* ccwl/ccwl.scm (filter-alist): New function. (input->tree): Use filter-alist.