Collection of Fractal helper tasks
This instructions are only relevant after you completed both the copier copy
command and the git/GitLab/GitHub initialization phase - see
README
for details.
It is recommended to work from an isolated Python virtual environment:
# Create the virtual environment in the folder venv
python -m venv venv
# Activate the Python virtual environment
source venv/bin/activate
# Deactivate the virtual environment, when you don't need it any more
deactivate
You can install your package locally as in:
# Install only fractal_helper_tasks:
python -m pip install -e .
# Install both fractal_helper_tasks and development dependencies (e.g. pytest):
python -m pip install -e ".[dev]"
Enjoy developing the package.
The template already includes a sample task ("Thresholding Task"). Whenever you change its input parameters or docstring, re-run
python src/fractal_helper_tasks/dev/update_manifest.py
git add src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json
git commit -m'Update `__FRACTAL_MANIFEST__.json`'
git push origin main
If you add a new task, you should also add a new item to the task_list
property in src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json
. A minimal example
may look like
{
"name": "My Second Task",
"executable": "my_second_task.py",
"input_type": "zarr",
"output_type": "zarr",
"meta": {
"some-property": "some-value"
},
}
Notes:
meta
task property; this is optional, and you can remove it if it is not needed.python -m pytest --log-cli-level info -s
python -m build
This command will create the release distribution files in the dist
folder.
The wheel one (ending with .whl
) is the one you can use to collect your tasks
within Fractal.