Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add configure_step/workflow #190

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

camilovelezr
Copy link
Member

@camilovelezr camilovelezr commented Feb 28, 2024

To. be merged after #192
This PR:

  • Improves error messages when compiling workflows: now the errors that WIC outputs when trying to compile will be shown to users when running Workflow.compile()
  • Adds new functions:
    • configure_step(clt_path, config_path):
      A JSON file with configuration values will be used to configure the CLT. For example, /home/omeconverter.cwl is the path to Ome Converter CLT. /home/omeconfig.json looks like:
      {
          "inpDir": "/home/camilovelezr/in",
          "outDir": "/home/camilovelezr/out",
          "filePattern": ".tif",
          "fileExtension": "ome.zarr"
      }
      Running
      from wic.api import configure_step
      ome_step = configure_step("/home/omeconverter.cwl", "/home/omeconfig.json")
      Will perform validation on each of the inputs and return a Step that points to the specified CLT and has the I/O values specified in the JSON file.
    • configure_workflow([clt_path1, clt_path2, ...], [config_path1, config_path2, ...], ...):
      Configure linear Workflow from list of CLT and configuration files.
      This function takes a list of CLT (Command Line Tool) files and a list of configuration files
      and creates a Workflow object. Each CLT file is paired with a corresponding configuration file
      based on their order in the lists. The Workflow object is then returned.
      configure_workflow(clt_list, config_list: list[StrPath],
              name: str,
              path: Union[str, Path] = Path.cwd(),
              compile_workflow: bool = True,
              run: bool = False,
              overwrite: bool = False) -> Workflow:
          Args:
              clt_list (list[StrPath]): A list of paths to CLT files.
              config_list (list[StrPath]): A list of paths to configuration files.
              name (str): The name of the Workflow.
              path (Optional[StrPath]): The path where the Workflow will be created. Defaults to `pathlib.Path.cwd()`.
              compile_workflow (bool): Flag indicating whether to compile the Workflow using WIC. Defaults to True.
              run (bool): Flag indicating whether to run the Workflow after configuration using WIC. Defaults to False.
              overwrite (bool): Flag indicating whether to overwrite existing CLT files in cwl_adapters. Defaults to False.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant