Skip to content

Commit 2092df2

Browse files
committed
[skip ci] consolidated READMEs
1 parent 71bd137 commit 2092df2

File tree

2 files changed

+108
-178
lines changed

2 files changed

+108
-178
lines changed

README.md

Lines changed: 108 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![PyPI - Python Version][pypi-pyversions]][pypi-project]
55
[![PyPI - Downloads][pypi-downloads]][pypi-project]
66
![][status-docs]
7-
![][status-test]
7+
![][status-cicd]
88

99
----
1010

@@ -22,12 +22,13 @@ to facilitate their integration into more advanced processing workflows.
2222

2323
**Table of contents**
2424

25-
- [Available interfaces](#available-interfaces)
25+
- [Tested interfaces](#available-interfaces)
2626
- [Installation](#installation)
27+
- [Automatic Conversion](#nipype-auto-conv)
2728
- [Development](#development)
2829
- [Licensing](#licensing)
2930

30-
## Available interfaces
31+
## Tested interfaces
3132

3233
| Module | Interfaces |
3334
|-----------|-----------------------------------------------------------------------------------------------------|
@@ -46,32 +47,126 @@ A separate installation of FreeSurfer is required to use this package.
4647
Please review the following [instructions][freesurfer-install]
4748
and [licensing details][freesurfer-license].
4849

50+
## Automatic Conversion
51+
52+
Automatically generated tasks can be found in the `pydra.tasks.freesurfer.auto` sub-package.
53+
These interfaces should be treated with caution as they likely do not pass testing.
54+
Generated tasks that have been edited and pass testing will be imported into one or more of the
55+
`pydra.tasks.freesurfer.v*` sub-packages (e.g. `pydra.tasks.freesurfer.v7_4`) corresponding
56+
to the version of the freesurfer toolkit they are designed for.
57+
58+
59+
### Continuous integration
60+
61+
This template uses [GitHub Actions](https://docs.github.com/en/actions/) to run tests and
62+
deploy packages to PYPI. New packages are built and uploaded when releases are created on
63+
GitHub, or new releases of Nipype or the Nipype2Pydra conversion tool are released.
64+
Releases triggered by updates to Nipype or Nipype2Pydra are signified by the `postN`
65+
suffix where `N = <nipype-version><nipype2pydra-version>` with the '.'s stripped, e.g.
66+
`v0.2.3post185010` corresponds to the v0.2.3 tag of this repository with auto-generated
67+
packages from Nipype 1.8.5 using Nipype2Pydra 0.1.0.
68+
4969
## Development
5070

51-
This project is managed with [Hatch][hatch]:
71+
### Methodology
72+
73+
The development of this package is expected to have two phases
74+
75+
1. Where the corresponding Nipype interfaces are considered to be the ground truth, and
76+
the Pydra tasks are generated from them
77+
2. When the Pydra tasks are considered be mature and they are edited by hand
78+
79+
Different tasks will probably mature at different times so there will probably be an
80+
intermediate phase between 1 and 2.
81+
82+
### Developer installation
83+
84+
Before the pydra task interfaces can be generated and installed, the file-format classes
85+
[fileformats](https://arcanaframework.github.io/fileformats/) packages
86+
corresponding to Freesurfer specific file formats will need to be installed
87+
88+
```console
89+
$ pip install -e ./related-packages/fileformats[dev]
90+
$ pip install -e ./related-packages/fileformats-extras[dev]
91+
```
92+
93+
Next install the requirements for running the auto-conversion script and generate the
94+
Pydra task interfaces from their Nipype counterparts
95+
96+
```console
97+
$ pip install -r nipype-auto-conv/requirements.txt
98+
```
99+
100+
The run the conversion script to convert Nipype interfaces to Pydra
101+
102+
```console
103+
$ nipype-auto-conv/generate
104+
```
105+
106+
Install repo in developer mode from the source directory and install pre-commit to
107+
ensure consistent code-style and quality.
52108

53109
```console
54-
pipx install hatch
110+
$ pip install -e .[test,dev]
111+
$ pre-commit install
55112
```
56113

57-
To run the test suite:
114+
### Auto-conversion phase
115+
116+
The auto-converted Pydra tasks are generated from their corresponding Nipype interface
117+
in combination with "conversion hints" contained in YAML specs
118+
located in `nipype-auto-conv/specs/`. The self-documented conversion specs are
119+
to be edited by hand in order to assist the auto-converter produce valid pydra tasks.
120+
After editing one or more conversion specs the `pydra.tasks.freesurfer.auto` package should
121+
be regenerated by running
58122

59123
```console
60-
hatch run test
124+
$ nipype-auto-conv/generate
61125
```
62126

63-
To fix linting issues:
127+
The tests should be run on the auto-generated tasks to see if they are valid
64128

65129
```console
66-
hatch run lint:fix
130+
$ pytest pydra/tasks/freesurfer/auto/tests/test_<the-name-of-the-task-you-edited>.py
67131
```
68132

69-
To check the documentation:
133+
If the test passes you should then edit the `pydra/tasks/freesurfer/v*/__init__.py` file
134+
to import the auto-generated task interface to signify that it has been validated and is
135+
ready for use, where v* corresponds to the version of Freesurfer that you have tested
136+
it against e.g.
70137

71138
```console
72-
hatch run docs:serve --open-browser
139+
from pydra.tasks.freesurfer.auto import <the-task-you-have-validated>
73140
```
74141

142+
and copy the test file `pydra/tasks/freesurfer/auto/tests/test_<validated-task>.py
143+
into `pydra/tasks/freesurfer/v*/tests`.
144+
145+
146+
### File-formats and sample test data
147+
148+
The automatically generated tests will attempt to provided the task instance to be tested
149+
with sensible default values based on the type of the field and any constraints it has
150+
on it. However, these will often need to be manually overridden after consulting the
151+
underlying tool's documentation.
152+
153+
For file-based data, automatically generated file-system objects will be created for
154+
selected format types, e.g. Nifti, Dicom. Therefore, it is important to specify the
155+
format of the file using the "mime-like" string corresponding to a
156+
[fileformats](https://github.com/ArcanaFramework/fileformats) class
157+
in the ``inputs > types`` and ``outputs > types`` dicts of the YAML spec.
158+
159+
If the required file-type is not found implemented within fileformats, please see the `fileformats
160+
docs [https://arcanaframework.github.io/fileformats/developer.html] for instructions on how to define
161+
new fileformat types, and see
162+
[fileformats-medimage-extras](https://github.com/ArcanaFramework/fileformats-medimage-extras/blob/6c2dabe91e95687eebc2639bb6f034cf9595ecfc/fileformats/extras/medimage/nifti.py#L30-L48)
163+
for an example on how to implement methods to generate sample data for them. Implementations of
164+
new fileformats that are specific to Freesurfer, and functions to
165+
generate sample data for them, should be defined in `related-packages/fileformats`
166+
and `related-packages/fileformats-extras`, respectively.
167+
168+
169+
75170
## Licensing
76171

77172
This project is distributed under the terms of the [Apache License, Version 2.0][license].
@@ -82,8 +177,6 @@ This project is distributed under the terms of the [Apache License, Version 2.0]
82177

83178
[freesurfer-license]: https://surfer.nmr.mgh.harvard.edu/registration.html
84179

85-
[hatch]: https://hatch.pypa.io
86-
87180
[license]: https://opensource.org/licenses/Apache-2.0
88181

89182
[pydra]: https://nipype.github.io/pydra
@@ -96,6 +189,6 @@ This project is distributed under the terms of the [Apache License, Version 2.0]
96189

97190
[pypi-version]: https://img.shields.io/pypi/v/pydra-freesurfer.svg
98191

99-
[status-docs]: https://github.com/aramis-lab/pydra-freesurfer/actions/workflows/docs.yaml/badge.svg
192+
[status-docs]: https://github.com/nipype/pydra-freesurfer/actions/workflows/docs.yaml/badge.svg
100193

101-
[status-test]: https://github.com/aramis-lab/pydra-freesurfer/actions/workflows/test.yaml/badge.svg
194+
[status-cicd]: https://github.com/nipype/pydra-freesurfer/actions/workflows/ci-cd.yaml/badge.svg

README.rst

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)