f30789aaf1f49e25059bc39d45656435d99c0677,skimage/measure/tests/test_profile.py,,test_reduce_func_lambda_linewidth_3,#,155

Before Change


def test_reduce_func_lambda_linewidth_3():
    prof = profile_line(pyth_image, (1, 2), (4, 2), linewidth=3, order=0,
                        reduce_func=lambda x: x + x**2)
    expected_prof = np.array([[5.04, 0.96, 0.96],
                              [0.96, 5.04, 5.04],
                              [0., 0.96, 5.04],
                              [0., 0., 0.96]])
    // The lambda function acts on each pixel value individually.
    assert_almost_equal(prof, expected_prof)

After Change


        return x + x ** 2
    prof = profile_line(pyth_image, (1, 2), (4, 2), linewidth=3, order=0,
                        reduce_func=reduce_func, mode="constant")
    expected_prof = np.apply_along_axis(reduce_func,
                                        arr=pyth_image[1:5, 1:4], axis=1)
    assert_almost_equal(prof, expected_prof)


def test_reduce_func_sqrt_linewidth_3():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: scikit-image/scikit-image
Commit Name: f30789aaf1f49e25059bc39d45656435d99c0677
Time: 2020-04-07
Author: rfezzani@gmail.com
File Name: skimage/measure/tests/test_profile.py
Class Name:
Method Name: test_reduce_func_lambda_linewidth_3


Project Name: scikit-image/scikit-image
Commit Name: f30789aaf1f49e25059bc39d45656435d99c0677
Time: 2020-04-07
Author: rfezzani@gmail.com
File Name: skimage/measure/tests/test_profile.py
Class Name:
Method Name: test_reduce_func_sumofsqrt_linewidth_3


Project Name: scikit-image/scikit-image
Commit Name: f30789aaf1f49e25059bc39d45656435d99c0677
Time: 2020-04-07
Author: rfezzani@gmail.com
File Name: skimage/measure/tests/test_profile.py
Class Name:
Method Name: test_reduce_func_sqrt_linewidth_3