fcc22e65a2d7f07e95d470f1c3d41f269b0e6fb2,nilearn/tests/test_niimg_conversions.py,,test_check_niimg,#,198

Before Change


    img_3_3d = [[[img_3d, img_3d]]]
    img_2_4d = [[img_4d, img_4d]]

    assert_raises_regex(
        DimensionError,
        "Input data has incompatible dimensionality: "
        "Expected dimension is 2D and you provided "
        "a list of list of list of 3D images \(6D\)",
        _utils.check_niimg, img_3_3d, ensure_ndim=2)

    assert_raises_regex(
        DimensionError,
        "Input data has incompatible dimensionality: "

After Change


                       ):
        _utils.check_niimg(img_3_3d, ensure_ndim=2)

    with pytest.raises(DimensionError,
                       match="Input data has incompatible dimensionality: "
                             "Expected dimension is 4D and you provided "
                             "a list of list of 4D images \(6D\)"
                       ):
        _utils.check_niimg(img_2_4d, ensure_ndim=4)

    // check data dtype equal with dtype="auto"
    img_3d_check = _utils.check_niimg(img_3d, dtype="auto")
    assert (
        get_data(img_3d).dtype.kind == get_data(img_3d_check).dtype.kind)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: nilearn/nilearn
Commit Name: fcc22e65a2d7f07e95d470f1c3d41f269b0e6fb2
Time: 2019-12-20
Author: kc.insight.pi@gmail.com
File Name: nilearn/tests/test_niimg_conversions.py
Class Name:
Method Name: test_check_niimg


Project Name: nilearn/nilearn
Commit Name: baa274adfe7df767c35f0f6523ff54f7f92d0f19
Time: 2013-12-18
Author: gael.varoquaux@normalesup.org
File Name: nilearn/tests/test_niimg_conversions.py
Class Name:
Method Name: test_check_niimg


Project Name: nilearn/nilearn
Commit Name: fcc22e65a2d7f07e95d470f1c3d41f269b0e6fb2
Time: 2019-12-20
Author: kc.insight.pi@gmail.com
File Name: nilearn/tests/test_niimg_conversions.py
Class Name:
Method Name: test_check_niimg_3d