Skip to content

Overhaul PyDesigner Code 2 #52

Overhaul PyDesigner Code 2

Overhaul PyDesigner Code 2 #52

GitHub Actions / Test Results failed Sep 12, 2024 in 0s

7 fail, 119 pass in 12s

126 tests  +126   119 ✅ +119   12s ⏱️ +12s
  1 suites +  1     0 💤 ±  0 
  1 files   +  1     7 ❌ +  7 

Results for commit dd8be94. ± Comparison against earlier commit d013c26.

Annotations

Check warning on line 0 in tests.test_preprocessing_mrpreproc

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_degibbs_output_failure (tests.test_preprocessing_mrpreproc) failed

test_results/results.xml [took 0s]
Raw output
pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_degibbs_output_failure0')

    def test_degibbs_output_failure(tmp_path):
        """Test whether function `degibbs` fails when return code is non-zero"""
        output_nii = str(tmp_path / "output.nii")
        with patch("subprocess.run") as mock_subprocess:
            mock_subprocess.return_value = MagicMock(
                returncode=1, stderr="stderr"
            )
            with pytest.raises(MRTrixError) as exc:
>               mrpreproc.degibbs(PATH_DWI, output_nii)

tests/test_preprocessing_mrpreproc.py:207: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pydesigner/preprocessing/mrpreproc.py:272: in degibbs
    input=input_path_validator(input, ".mif"),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/src/tests/data/hifi/hifi_splenium_4vox.nii', ctype = '.mif'

    def input_path_validator(path: str, ctype: str = None):
        """Validates a provided input path
    
        Parameters
        ----------
        path : str
            Path to input file
        ctype : str
            File extension to enfore on input path
    
        Returns
        -------
            str
                Sanitized path
    
        See Also
        --------
        output_path_validator
        """
        opts = modelmrtrix(input=path)
        if ctype is not None:
            if not isinstance(ctype, str):
                msg = f"ctype variable (ctype={ctype}) needs to be a valid string."
                raise (TypeError(msg))
        if ctype:
            if op.splitext(op.basename(opts.input))[-1] != ctype:
                msg = f"Input file ({path}) does not posses the required {ctype} extension."
>               raise FileExtensionError(msg)
E               pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.

pydesigner/system/models.py:93: FileExtensionError

Check warning on line 0 in tests.test_preprocessing_mrpreproc

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_degibbs_output_success[None-None-None] (tests.test_preprocessing_mrpreproc) failed

test_results/results.xml [took 0s]
Raw output
pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_degibbs_output_success_No0')
nthreads = None, force = None, verbose = None

    @pytest.mark.parametrize(
        "nthreads, force, verbose",
        [
            (None, None, None),
            (1, None, None),
            (None, True, None),
            (None, False, None),
            (None, None, True),
            (None, None, False),
        ]
    )
    def test_degibbs_output_success(tmp_path, nthreads, force, verbose):
        """Test whether function `degibbs` fails when return code is non-zero"""
        output_mif = str(tmp_path / "output.mif")
>       mrpreproc.degibbs(PATH_DWI, output_mif, nthreads=nthreads, force=force, verbose=verbose)

tests/test_preprocessing_mrpreproc.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pydesigner/preprocessing/mrpreproc.py:272: in degibbs
    input=input_path_validator(input, ".mif"),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/src/tests/data/hifi/hifi_splenium_4vox.nii', ctype = '.mif'

    def input_path_validator(path: str, ctype: str = None):
        """Validates a provided input path
    
        Parameters
        ----------
        path : str
            Path to input file
        ctype : str
            File extension to enfore on input path
    
        Returns
        -------
            str
                Sanitized path
    
        See Also
        --------
        output_path_validator
        """
        opts = modelmrtrix(input=path)
        if ctype is not None:
            if not isinstance(ctype, str):
                msg = f"ctype variable (ctype={ctype}) needs to be a valid string."
                raise (TypeError(msg))
        if ctype:
            if op.splitext(op.basename(opts.input))[-1] != ctype:
                msg = f"Input file ({path}) does not posses the required {ctype} extension."
>               raise FileExtensionError(msg)
E               pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.

pydesigner/system/models.py:93: FileExtensionError

Check warning on line 0 in tests.test_preprocessing_mrpreproc

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_degibbs_output_success[1-None-None] (tests.test_preprocessing_mrpreproc) failed

test_results/results.xml [took 0s]
Raw output
pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_degibbs_output_success_1_0')
nthreads = 1, force = None, verbose = None

    @pytest.mark.parametrize(
        "nthreads, force, verbose",
        [
            (None, None, None),
            (1, None, None),
            (None, True, None),
            (None, False, None),
            (None, None, True),
            (None, None, False),
        ]
    )
    def test_degibbs_output_success(tmp_path, nthreads, force, verbose):
        """Test whether function `degibbs` fails when return code is non-zero"""
        output_mif = str(tmp_path / "output.mif")
>       mrpreproc.degibbs(PATH_DWI, output_mif, nthreads=nthreads, force=force, verbose=verbose)

tests/test_preprocessing_mrpreproc.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pydesigner/preprocessing/mrpreproc.py:272: in degibbs
    input=input_path_validator(input, ".mif"),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/src/tests/data/hifi/hifi_splenium_4vox.nii', ctype = '.mif'

    def input_path_validator(path: str, ctype: str = None):
        """Validates a provided input path
    
        Parameters
        ----------
        path : str
            Path to input file
        ctype : str
            File extension to enfore on input path
    
        Returns
        -------
            str
                Sanitized path
    
        See Also
        --------
        output_path_validator
        """
        opts = modelmrtrix(input=path)
        if ctype is not None:
            if not isinstance(ctype, str):
                msg = f"ctype variable (ctype={ctype}) needs to be a valid string."
                raise (TypeError(msg))
        if ctype:
            if op.splitext(op.basename(opts.input))[-1] != ctype:
                msg = f"Input file ({path}) does not posses the required {ctype} extension."
>               raise FileExtensionError(msg)
E               pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.

pydesigner/system/models.py:93: FileExtensionError

Check warning on line 0 in tests.test_preprocessing_mrpreproc

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_degibbs_output_success[None-True-None] (tests.test_preprocessing_mrpreproc) failed

test_results/results.xml [took 0s]
Raw output
pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_degibbs_output_success_No1')
nthreads = None, force = True, verbose = None

    @pytest.mark.parametrize(
        "nthreads, force, verbose",
        [
            (None, None, None),
            (1, None, None),
            (None, True, None),
            (None, False, None),
            (None, None, True),
            (None, None, False),
        ]
    )
    def test_degibbs_output_success(tmp_path, nthreads, force, verbose):
        """Test whether function `degibbs` fails when return code is non-zero"""
        output_mif = str(tmp_path / "output.mif")
>       mrpreproc.degibbs(PATH_DWI, output_mif, nthreads=nthreads, force=force, verbose=verbose)

tests/test_preprocessing_mrpreproc.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pydesigner/preprocessing/mrpreproc.py:272: in degibbs
    input=input_path_validator(input, ".mif"),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/src/tests/data/hifi/hifi_splenium_4vox.nii', ctype = '.mif'

    def input_path_validator(path: str, ctype: str = None):
        """Validates a provided input path
    
        Parameters
        ----------
        path : str
            Path to input file
        ctype : str
            File extension to enfore on input path
    
        Returns
        -------
            str
                Sanitized path
    
        See Also
        --------
        output_path_validator
        """
        opts = modelmrtrix(input=path)
        if ctype is not None:
            if not isinstance(ctype, str):
                msg = f"ctype variable (ctype={ctype}) needs to be a valid string."
                raise (TypeError(msg))
        if ctype:
            if op.splitext(op.basename(opts.input))[-1] != ctype:
                msg = f"Input file ({path}) does not posses the required {ctype} extension."
>               raise FileExtensionError(msg)
E               pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.

pydesigner/system/models.py:93: FileExtensionError

Check warning on line 0 in tests.test_preprocessing_mrpreproc

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_degibbs_output_success[None-False-None] (tests.test_preprocessing_mrpreproc) failed

test_results/results.xml [took 0s]
Raw output
pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_degibbs_output_success_No2')
nthreads = None, force = False, verbose = None

    @pytest.mark.parametrize(
        "nthreads, force, verbose",
        [
            (None, None, None),
            (1, None, None),
            (None, True, None),
            (None, False, None),
            (None, None, True),
            (None, None, False),
        ]
    )
    def test_degibbs_output_success(tmp_path, nthreads, force, verbose):
        """Test whether function `degibbs` fails when return code is non-zero"""
        output_mif = str(tmp_path / "output.mif")
>       mrpreproc.degibbs(PATH_DWI, output_mif, nthreads=nthreads, force=force, verbose=verbose)

tests/test_preprocessing_mrpreproc.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pydesigner/preprocessing/mrpreproc.py:272: in degibbs
    input=input_path_validator(input, ".mif"),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/src/tests/data/hifi/hifi_splenium_4vox.nii', ctype = '.mif'

    def input_path_validator(path: str, ctype: str = None):
        """Validates a provided input path
    
        Parameters
        ----------
        path : str
            Path to input file
        ctype : str
            File extension to enfore on input path
    
        Returns
        -------
            str
                Sanitized path
    
        See Also
        --------
        output_path_validator
        """
        opts = modelmrtrix(input=path)
        if ctype is not None:
            if not isinstance(ctype, str):
                msg = f"ctype variable (ctype={ctype}) needs to be a valid string."
                raise (TypeError(msg))
        if ctype:
            if op.splitext(op.basename(opts.input))[-1] != ctype:
                msg = f"Input file ({path}) does not posses the required {ctype} extension."
>               raise FileExtensionError(msg)
E               pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.

pydesigner/system/models.py:93: FileExtensionError

Check warning on line 0 in tests.test_preprocessing_mrpreproc

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_degibbs_output_success[None-None-True] (tests.test_preprocessing_mrpreproc) failed

test_results/results.xml [took 0s]
Raw output
pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_degibbs_output_success_No3')
nthreads = None, force = None, verbose = True

    @pytest.mark.parametrize(
        "nthreads, force, verbose",
        [
            (None, None, None),
            (1, None, None),
            (None, True, None),
            (None, False, None),
            (None, None, True),
            (None, None, False),
        ]
    )
    def test_degibbs_output_success(tmp_path, nthreads, force, verbose):
        """Test whether function `degibbs` fails when return code is non-zero"""
        output_mif = str(tmp_path / "output.mif")
>       mrpreproc.degibbs(PATH_DWI, output_mif, nthreads=nthreads, force=force, verbose=verbose)

tests/test_preprocessing_mrpreproc.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pydesigner/preprocessing/mrpreproc.py:272: in degibbs
    input=input_path_validator(input, ".mif"),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/src/tests/data/hifi/hifi_splenium_4vox.nii', ctype = '.mif'

    def input_path_validator(path: str, ctype: str = None):
        """Validates a provided input path
    
        Parameters
        ----------
        path : str
            Path to input file
        ctype : str
            File extension to enfore on input path
    
        Returns
        -------
            str
                Sanitized path
    
        See Also
        --------
        output_path_validator
        """
        opts = modelmrtrix(input=path)
        if ctype is not None:
            if not isinstance(ctype, str):
                msg = f"ctype variable (ctype={ctype}) needs to be a valid string."
                raise (TypeError(msg))
        if ctype:
            if op.splitext(op.basename(opts.input))[-1] != ctype:
                msg = f"Input file ({path}) does not posses the required {ctype} extension."
>               raise FileExtensionError(msg)
E               pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.

pydesigner/system/models.py:93: FileExtensionError

Check warning on line 0 in tests.test_preprocessing_mrpreproc

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_degibbs_output_success[None-None-False] (tests.test_preprocessing_mrpreproc) failed

test_results/results.xml [took 0s]
Raw output
pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_degibbs_output_success_No4')
nthreads = None, force = None, verbose = False

    @pytest.mark.parametrize(
        "nthreads, force, verbose",
        [
            (None, None, None),
            (1, None, None),
            (None, True, None),
            (None, False, None),
            (None, None, True),
            (None, None, False),
        ]
    )
    def test_degibbs_output_success(tmp_path, nthreads, force, verbose):
        """Test whether function `degibbs` fails when return code is non-zero"""
        output_mif = str(tmp_path / "output.mif")
>       mrpreproc.degibbs(PATH_DWI, output_mif, nthreads=nthreads, force=force, verbose=verbose)

tests/test_preprocessing_mrpreproc.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pydesigner/preprocessing/mrpreproc.py:272: in degibbs
    input=input_path_validator(input, ".mif"),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/src/tests/data/hifi/hifi_splenium_4vox.nii', ctype = '.mif'

    def input_path_validator(path: str, ctype: str = None):
        """Validates a provided input path
    
        Parameters
        ----------
        path : str
            Path to input file
        ctype : str
            File extension to enfore on input path
    
        Returns
        -------
            str
                Sanitized path
    
        See Also
        --------
        output_path_validator
        """
        opts = modelmrtrix(input=path)
        if ctype is not None:
            if not isinstance(ctype, str):
                msg = f"ctype variable (ctype={ctype}) needs to be a valid string."
                raise (TypeError(msg))
        if ctype:
            if op.splitext(op.basename(opts.input))[-1] != ctype:
                msg = f"Input file ({path}) does not posses the required {ctype} extension."
>               raise FileExtensionError(msg)
E               pydesigner.system.errors.FileExtensionError: Input file (/src/tests/data/hifi/hifi_splenium_4vox.nii) does not posses the required .mif extension.

pydesigner/system/models.py:93: FileExtensionError