jluethi / fractal-helper-tasks

Collection of Fractal helper tasks
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

fractal-helper-tasks

License Python version GitHub Workflow Status codecov

Collection of Fractal helper tasks

Development instructions

This instructions are only relevant after you completed both the copier copy command and the git/GitLab/GitHub initialization phase - see README for details.

  1. 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
  2. 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]"
  3. Enjoy developing the package.

  4. 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
  5. 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:

  1. Run the test suite (with somewhat verbose logging) through
    python -m pytest --log-cli-level info -s
  2. Build the package through
    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.