Skip to content

Host-specific reg_average_cmd file created in testing directory during tests #2672

Open
@effigies

Description

@effigies

Summary

NiftyReg doctests create a host-specific file in <repo_root>/nipype/testing/data/reg_average_cmd.

For example, the contents of the file in my repository are:

reg_average /Users/markiewicz/Projects/nipype/nipype/testing/data/avg_out.nii.gz -avg im1.nii im2.nii im3.nii -omp 1

This is created by the doctest here:

class RegAverage(NiftyRegCommand):
"""Interface for executable reg_average from NiftyReg platform.
Compute average matrix or image from a list of matrices or image.
The tool can be use to resample images given input transformation
parametrisation as well as to demean transformations in Euclidean or
log-Euclidean space.
This interface is different than the others in the way that the options
will be written in a command file that is given as a parameter.
`Source code <https://cmiclab.cs.ucl.ac.uk/mmodat/niftyreg>`_
Examples
--------
>>> from nipype.interfaces import niftyreg
>>> node = niftyreg.RegAverage()
>>> one_file = 'im1.nii'
>>> two_file = 'im2.nii'
>>> three_file = 'im3.nii'
>>> node.inputs.avg_files = [one_file, two_file, three_file]
>>> node.cmdline # doctest: +ELLIPSIS
'reg_average --cmd_file .../reg_average_cmd'
"""

Expected behavior

Tests should not leave modified files in the repository.

How to replicate the behavior

make check-before-commit

Script/Workflow details

Please put URL to code or code here (if not too long).

Platform details:

{'commit_hash': '%h',
 'commit_source': 'archive substitution',
 'networkx_version': '2.1',
 'nibabel_version': '2.3.0',
 'nipype_version': '1.1.0',
 'numpy_version': '1.14.3',
 'pkg_path': '/anaconda3/lib/python3.6/site-packages/nipype',
 'scipy_version': '1.1.0',
 'sys_executable': '/anaconda3/bin/python',
 'sys_platform': 'darwin',
 'sys_version': '3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37) \n'
                '[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]',
 'traits_version': '4.6.0'}
1.1.0

Execution environment

Choose one

  • My python environment outside container

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions