https://github.com/polusai/tools
https://github.com/polusai/tools
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/polusai/tools
- Owner: PolusAI
- License: mit
- Created: 2024-02-21T15:32:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-28T14:04:01.000Z (over 1 year ago)
- Last Synced: 2025-02-28T19:56:02.509Z (over 1 year ago)
- Language: Python
- Size: 196 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Polus Tools
## polus.tool.workflows
This package provides model that represents CWL workflows and command line
tools following the latest [cwl spec](https://www.commonwl.org/v1.2/).
It also provides tools to load, save, build and execute cwl tools and workflows.
It requires no configuration and focus on ease of use and modularity.
### How to install
the workflow builder is written and tested for Python 3.x {x = 9, 10, 11}.
Use you prefered method to create a new environment then :
with pip: `pip install .`
or with poetry: `poetry install`
### How to use
`python examples/workflows/demo_image_processing.py` for a basic example of use.
This tool allows people to load clts and workflows from a path or a URI.
The `CommandLineTool` and `Workflow` models are found in `polus.tools.workflow.model`.
Then workflows can be build thanks to two builder classes : `StepBuilder` and `WorkflowBuilder`.
Those builders are configurable to further customize how they operate.
The tool provide an easy way to configure a workflow through regular python assignments.
Ex:
assigning a value to a step input : `step1.inputA = "input_message"`
linking an step output to another step input : `step2.inputA = step1.outputA`
Once configured and build, a `workflow` object can be persisted with `workflow.save()`
and its configuration with `workflow.save_config()`
Lastly we provide a convenience method to run workflows locally with `cwltool`
by calling `polus.tools.workflows.backends.run_cwl()`.
### Structure
`src/polus/tools/workflows` contains the source code.
`tests/workflows` contains the test suite.
`tests/worklflows/test_data` contains a variety of cwl processes definitions.
`examples` contains our examples.
Other data directories:
`cwl` contains cwl definitions of processes we use as building blocks.
`cwl_generated` contains cwl definitions of processes generated by the tool.
`tmp` will be created on the first run and will contains examples outputs.
### Current Workflow features
This tool supports creating workflows containing:
- subworkflows
- conditional clauses
- scattered inputs
- multiple inputs
### Developers
Some hooks should run on commits. Please run `pre-commit install` to set up the hooks
before contributing.