Skip to main content

Pydra tasks package for AFNI

Project description

Pydra task package for afni

CI/CD codecov Python versions Latest Version

This package contains a collection of Pydra task interfaces for the afni toolkit. The basis of this collection has been formed by the semi-automatic conversion of existing Nipype interfaces to Pydra using the Nipype2Pydra tool

Automatically-generated vs manually-curated tasks

Automatically generated tasks can be found in the pydra.tasks.afni.auto package. These packages should be treated with extreme caution as they likely do not pass testing. Generated tasks that have been edited and pass testing are imported into one or more of the pydra.tasks.afni.v* packages, corresponding to the version of the afni toolkit they are designed for.

Tests

This package comes with a battery of automatically generated test modules. To install the necessary dependencies to run the tests

$ pip install -e .[test]

Then the tests, including doctests, can be launched using

$ pytest --doctest-modules pydra/tasks/*

By default, the tests are set to time-out after 10s, after which the underlying tool is assumed to have passed the validation/initialisation phase and we assume that it will run to completion. To disable this and run the test(s) through to completion run

$ pytest --doctest-modules --timeout-pass 0 pydra/tasks/*

Continuous integration

This template uses GitHub Actions to run tests and deploy packages to PYPI. New packages are built and uploaded when releases are created on GitHub, or new releases of Nipype or the Nipype2Pydra conversion tool are released. Releases triggered by updates to Nipype or Nipype2Pydra are signified by the postN suffix where N = <nipype-version><nipype2pydra-version> with the '.'s stripped, e.g. v0.2.3post185010 corresponds to the v0.2.3 tag of this repository with auto-generated packages from Nipype 1.8.5 using Nipype2Pydra 0.1.0.

Contributing to this package

Developer installation

Install repo in developer mode from the source directory and install pre-commit to ensure consistent code-style and quality.

$ pip install -e .[test,dev]
$ pre-commit install

Next install the requirements for running the auto-conversion script and generate the Pydra task interfaces from their Nipype counterparts

$ pip install -r nipype-auto-conv/requirements.txt

The run the conversion script to convert Nipype interfaces to Pydra

$ nipype-auto-conv/generate

Methodology

The development of this package is expected to have two phases

  1. Where the corresponding Nipype interfaces are considered to be the ground truth, and the Pydra tasks are generated from them
  2. When the Pydra tasks are considered be mature and they are edited by hand

Different tasks will probably mature at different times so there will probably be an intermediate phase between 1 and 2.

Auto-conversion phase

The auto-converted Pydra tasks are generated from their corresponding Nipype interface in combination with "conversion hints" contained in YAML specs located in nipype-auto-conv/specs/. The self-documented conversion specs are to be edited by hand in order to assist the auto-converter produce valid pydra tasks. After editing one or more conversion specs the pydra.tasks.afni.auto package should be regenerated by running

$ nipype-auto-conv/generate

The tests should be run on the auto-generated tasks to see if they are valid

$ pytest --doctest-modules pydra/tasks/afni/auto/tests/test_<the-name-of-the-task-you-edited>.py

If the test passes you should then edit the pydra/tasks/afni/v<tool-version>/__init__.py file to import the now valid task interface to signify that it has been validated and is ready for use, e.g.

from pydra.tasks.afni.auto import <the-task-you-have-validated>

Typing and sample test data

The automatically generated tests will attempt to provided the task instance to be tested with sensible default values based on the type of the field and any constraints it has on it. However, these will often need to be manually overridden after consulting the underlying tool's documentation.

For file-based data, automatically generated file-system objects will be created for selected format types, e.g. Nifti, Dicom. Therefore, it is important to specify the format of the file using the "mime-like" string corresponding to a fileformats class in the inputs > types and outputs > types dicts of the YAML spec.

If the required file-type is not found implemented within fileformats, please see the fileformats docs for instructions on how to define new fileformat types, and see fileformats-medimage-extras for an example on how to implement methods to generate sample data for them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydra_tasks_afni-0.5.0.tar.gz (74.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydra_tasks_afni-0.5.0-py3-none-any.whl (143.8 kB view details)

Uploaded Python 3

File details

Details for the file pydra_tasks_afni-0.5.0.tar.gz.

File metadata

  • Download URL: pydra_tasks_afni-0.5.0.tar.gz
  • Upload date:
  • Size: 74.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pydra_tasks_afni-0.5.0.tar.gz
Algorithm Hash digest
SHA256 bf82ac9b987133215a1b192b1526dfec4b7807691158c81f6f4fd8b99be2ce49
MD5 2e8b5f2f383cf8265e85a674a71612cc
BLAKE2b-256 62f53458180cdad8910046c669312dfb1fd84f8a9310579463455307ce4a7b7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydra_tasks_afni-0.5.0.tar.gz:

Publisher: ci-cd.yaml on nipype/pydra-tasks-afni

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydra_tasks_afni-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pydra_tasks_afni-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d452575d8125fce41f3b716a4b6a6411647674829250badb440e79b430a3fc91
MD5 dac40245d11c6fcaf7f4b5fa723bdfc4
BLAKE2b-256 abf807b9567033c0db3faef58c4817be9c47de3c92880ee00feb9af20c1b83cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydra_tasks_afni-0.5.0-py3-none-any.whl:

Publisher: ci-cd.yaml on nipype/pydra-tasks-afni

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page