pydra-afni


Namepydra-afni JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
SummaryPydra tasks package for afni
upload_time2024-05-20 06:36:28
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseCopyright 2021 Nipype developers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords pydra
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===========================
Pydra task package for afni
===========================

.. image:: https://github.com/nipype/pydra-afni/actions/workflows/ci-cd.yaml/badge.svg
   :target: https://github.com/nipype/pydra-afni/actions/workflows/ci-cd.yaml
.. image:: https://codecov.io/gh/nipype/pydra-afni/branch/main/graph/badge.svg?token=UIS0OGPST7
   :target: https://codecov.io/gh/nipype/pydra-afni
.. image:: https://img.shields.io/pypi/pyversions/pydra-afni.svg
   :target: https://pypi.python.org/pypi/pydra-afni/
   :alt: Supported Python versions
.. image:: https://img.shields.io/pypi/v/pydra-afni.svg
   :target: https://pypi.python.org/pypi/pydra-afni/
   :alt: 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 <https://github.com/nipy/nipype>`__ interfaces to Pydra using the
`Nipype2Pydra <https://github.com/nipype/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

.. code-block::

   $ pip install -e .[test]

Then the tests, including `doctests` <https://docs.python.org/3/library/doctest.html>`__, can be launched using

.. code-block::

   $ 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

.. code-block::

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

Continuous integration
----------------------

This template uses `GitHub Actions <https://docs.github.com/en/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.

.. code-block::

   $ 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

.. code-block::

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

The run the conversion script to convert Nipype interfaces to Pydra

.. code-block::

   $ 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

.. code-block::

   $ nipype-auto-conv/generate

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

.. code-block::

   $ 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.

.. code-block::python

   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 <https://github.com/ArcanaFramework/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 <https://arcanaframework.github.io/fileformats/developer.html>`__ for instructions on how to define
new fileformat types, and see 
`fileformats-medimage-extras <https://github.com/ArcanaFramework/fileformats-medimage-extras/blob/6c2dabe91e95687eebc2639bb6f034cf9595ecfc/fileformats/extras/medimage/nifti.py#L30-L48>`__
for an example on how to implement methods to generate sample data for them.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pydra-afni",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Nipype developers <neuroimaging@python.org>",
    "keywords": "pydra",
    "author": null,
    "author_email": "Nipype developers <neuroimaging@python.org>",
    "download_url": "https://files.pythonhosted.org/packages/dc/12/4e86cd7d5ebc9c72f05233ce6902683b8ca78d897195fd6ac2b47e13fb1b/pydra_afni-0.3.2.tar.gz",
    "platform": null,
    "description": "===========================\nPydra task package for afni\n===========================\n\n.. image:: https://github.com/nipype/pydra-afni/actions/workflows/ci-cd.yaml/badge.svg\n   :target: https://github.com/nipype/pydra-afni/actions/workflows/ci-cd.yaml\n.. image:: https://codecov.io/gh/nipype/pydra-afni/branch/main/graph/badge.svg?token=UIS0OGPST7\n   :target: https://codecov.io/gh/nipype/pydra-afni\n.. image:: https://img.shields.io/pypi/pyversions/pydra-afni.svg\n   :target: https://pypi.python.org/pypi/pydra-afni/\n   :alt: Supported Python versions\n.. image:: https://img.shields.io/pypi/v/pydra-afni.svg\n   :target: https://pypi.python.org/pypi/pydra-afni/\n   :alt: Latest Version\n\n\nThis package contains a collection of Pydra task interfaces for the afni toolkit.\nThe basis of this collection has been formed by the semi-automatic conversion of\nexisting `Nipype <https://github.com/nipy/nipype>`__ interfaces to Pydra using the\n`Nipype2Pydra <https://github.com/nipype/nipype2pydra>`__ tool\n\n\nAutomatically-generated vs manually-curated tasks\n-------------------------------------------------\n\nAutomatically generated tasks can be found in the `pydra.tasks.afni.auto` package.\nThese packages should be treated with extreme caution as they likely do not pass testing.\nGenerated tasks that have been edited and pass testing are imported into one or more of the\n`pydra.tasks.afni.v*` packages, corresponding to the version of the afni toolkit\nthey are designed for. \n\nTests\n-----\n\nThis package comes with a battery of automatically generated test modules. To install\nthe necessary dependencies to run the tests\n\n.. code-block::\n\n   $ pip install -e .[test]\n\nThen the tests, including `doctests` <https://docs.python.org/3/library/doctest.html>`__, can be launched using\n\n.. code-block::\n\n   $ pytest --doctest-modules pydra/tasks/*\n\nBy default, the tests are set to time-out after 10s, after which the underlying tool is\nassumed to have passed the validation/initialisation phase and we assume that it will\nrun to completion. To disable this and run the test(s) through to completion run\n\n.. code-block::\n\n   $ pytest --doctest-modules --timeout-pass 0 pydra/tasks/*\n\nContinuous integration\n----------------------\n\nThis template uses `GitHub Actions <https://docs.github.com/en/actions/>`__` to run tests and\ndeploy packages to PYPI. New packages are built and uploaded when releases are created on\nGitHub, or new releases of Nipype or the Nipype2Pydra conversion tool are released.\nReleases triggered by updates to Nipype or Nipype2Pydra are signified by the `postN`\nsuffix where `N = <nipype-version><nipype2pydra-version>` with the '.'s stripped, e.g.\n`v0.2.3post185010` corresponds to the v0.2.3 tag of this repository with auto-generated\npackages from Nipype 1.8.5 using Nipype2Pydra 0.1.0.\n\n\nContributing to this package\n----------------------------\n\nDeveloper installation\n~~~~~~~~~~~~~~~~~~~~~~\n\n\nInstall repo in developer mode from the source directory and install pre-commit to\nensure consistent code-style and quality.\n\n.. code-block::\n\n   $ pip install -e .[test,dev]\n   $ pre-commit install\n\nNext install the requirements for running the auto-conversion script and generate the\nPydra task interfaces from their Nipype counterparts\n\n.. code-block::\n\n   $ pip install -r nipype-auto-conv/requirements.txt\n\nThe run the conversion script to convert Nipype interfaces to Pydra\n\n.. code-block::\n\n   $ nipype-auto-conv/generate\n\n## Methodology\n\nThe development of this package is expected to have two phases\n\n1. Where the corresponding Nipype interfaces are considered to be the ground truth, and\n   the Pydra tasks are generated from them\n2. When the Pydra tasks are considered be mature and they are edited by hand\n\nDifferent tasks will probably mature at different times so there will probably be an\nintermediate phase between 1 and 2.\n\nAuto-conversion phase\n~~~~~~~~~~~~~~~~~~~~~\n\nThe auto-converted Pydra tasks are generated from their corresponding Nipype interface\nin combination with \"conversion hints\" contained in YAML specs\nlocated in `nipype-auto-conv/specs/`. The self-documented conversion specs are\nto be edited by hand in order to assist the auto-converter produce valid pydra tasks.\nAfter editing one or more conversion specs the `pydra.tasks.afni.auto` package should\nbe regenerated by running\n\n.. code-block::\n\n   $ nipype-auto-conv/generate\n\nThe tests should be run on the auto-generated tasks to see if they are valid\n\n.. code-block::\n\n   $ pytest --doctest-modules pydra/tasks/afni/auto/tests/test_<the-name-of-the-task-you-edited>.py\n\nIf the test passes you should then edit the `pydra/tasks/afni/v<tool-version>/__init__.py` file\nto import the now valid task interface to signify that it has been validated and is ready\nfor use, e.g.\n\n.. code-block::python\n\n   from pydra.tasks.afni.auto import <the-task-you-have-validated>\n\n\nTyping and sample test data\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe automatically generated tests will attempt to provided the task instance to be tested\nwith sensible default values based on the type of the field and any constraints it has\non it. However, these will often need to be manually overridden after consulting the\nunderlying tool's documentation.\n\nFor file-based data, automatically generated file-system objects will be created for\nselected format types, e.g. Nifti, Dicom. Therefore, it is important to specify the\nformat of the file using the \"mime-like\" string corresponding to a\n`fileformats <https://github.com/ArcanaFramework/fileformats>`__ class\nin the ``inputs > types`` and ``outputs > types`` dicts of the YAML spec.\n\nIf the required file-type is not found implemented within fileformats, please see the `fileformats\ndocs <https://arcanaframework.github.io/fileformats/developer.html>`__ for instructions on how to define\nnew fileformat types, and see \n`fileformats-medimage-extras <https://github.com/ArcanaFramework/fileformats-medimage-extras/blob/6c2dabe91e95687eebc2639bb6f034cf9595ecfc/fileformats/extras/medimage/nifti.py#L30-L48>`__\nfor an example on how to implement methods to generate sample data for them.\n",
    "bugtrack_url": null,
    "license": "Copyright 2021 Nipype developers  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
    "summary": "Pydra tasks package for afni",
    "version": "0.3.2",
    "project_urls": null,
    "split_keywords": [
        "pydra"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4428a4e9ffb290e4601f16fe4feb0a7b1fa88b2827b06269248367402365119d",
                "md5": "5d609be2545b3b3cf214fb035e250b1c",
                "sha256": "a1fed24951d6aa8d4a628d1af6a3d4d415854a85d287201bd37f6173986bbc81"
            },
            "downloads": -1,
            "filename": "pydra_afni-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d609be2545b3b3cf214fb035e250b1c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 220741,
            "upload_time": "2024-05-20T06:36:25",
            "upload_time_iso_8601": "2024-05-20T06:36:25.602514Z",
            "url": "https://files.pythonhosted.org/packages/44/28/a4e9ffb290e4601f16fe4feb0a7b1fa88b2827b06269248367402365119d/pydra_afni-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc124e86cd7d5ebc9c72f05233ce6902683b8ca78d897195fd6ac2b47e13fb1b",
                "md5": "a71f7287c1ee1cc03658653b22b4a503",
                "sha256": "9d2cffa916eaf934adfa5c6606fd53fabeb7ff71d8f380c28eb98f1cab0a1e17"
            },
            "downloads": -1,
            "filename": "pydra_afni-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a71f7287c1ee1cc03658653b22b4a503",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 198306,
            "upload_time": "2024-05-20T06:36:28",
            "upload_time_iso_8601": "2024-05-20T06:36:28.271135Z",
            "url": "https://files.pythonhosted.org/packages/dc/12/4e86cd7d5ebc9c72f05233ce6902683b8ca78d897195fd6ac2b47e13fb1b/pydra_afni-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-20 06:36:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pydra-afni"
}
        
Elapsed time: 0.30340s