Skip to content

From Python scripts

The fractal-tasks-core GitHub repository includes an examples folder, listing a few examples of how to run fractal-tasks-core tasks from a standard Python script (instead of using the Fractal platform).

What follows is the content of examples/README.md:

Examples

This examples folder offers a few examples of how to run fractal-tasks-core tasks as part of a Python script.

Notes

General instructions

The following instructions are valid for all examples; check the specific README.md files in each folder for more specific details.

  1. Set up the correct environment via

    pip install fractal-tasks-core[fractal-tasks]
    
    (note: this can be done e.g. from a venv or from a conda environment).

  2. Download the example data from Zenodo, if necessary, via

    pip install zenodo-get
    ./fetch_test_data_from_zenodo.sh
    

  3. Enter one of the example folders, remove the tmp_out temporary output folder (if present), and run one of the run_workflow Python scripts.

  4. View the output OME-Zarr in the tmp_out folder with napari, which can be installed via pip install napari[pyqt5] napari-ome-zarr.