e5b8e81d2d33823142cc88eed6a5368c8e283a98,scipy/spatial/tests/test_distance.py,TestSomeDistanceFunctions,test_minkowski,#TestSomeDistanceFunctions#,1152

Before Change


        self.cases = [(x,y), (x31, y31), (x13, y13)]

    def test_minkowski(self):
        for x, y in self.cases:
            dist1 = minkowski(x, y, p=1)
            assert_almost_equal(dist1, 3.0)
            dist1p5 = minkowski(x, y, p=1.5)
            assert_almost_equal(dist1p5, (1.0+2.0**1.5)**(2./3))
            dist2 = minkowski(x, y, p=2)
            assert_almost_equal(dist2, np.sqrt(5))

    def test_wminkowski(self):
        w = np.array([1.0, 2.0, 0.5])
        for x, y in self.cases:
            dist1 = wminkowski(x, y, p=1, w=w)

After Change


        self.cases = [(x,y), (x31, y31), (x13, y13)]

    def test_minkowski(self):
        with suppress_warnings() as w:
            w.filter(message="`wminkowski` is deprecated")
            for x, y in self.cases:
                dist1 = wminkowski(x, y, p=1)
                assert_almost_equal(dist1, 3.0)
                dist1p5 = wminkowski(x, y, p=1.5)
                assert_almost_equal(dist1p5, (1.0+2.0**1.5)**(2./3))
                dist2 = wminkowski(x, y, p=2)

    def test_euclidean(self):
        for x, y in self.cases:
            dist = weuclidean(x, y)
            assert_almost_equal(dist, np.sqrt(5))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 7

Non-data size: 8

Instances


Project Name: scipy/scipy
Commit Name: e5b8e81d2d33823142cc88eed6a5368c8e283a98
Time: 2017-09-13
Author: apbard@users.noreply.github.com
File Name: scipy/spatial/tests/test_distance.py
Class Name: TestSomeDistanceFunctions
Method Name: test_minkowski


Project Name: scipy/scipy
Commit Name: b4fe8a68c4a358db8bf734bb630b144c1a4a00ac
Time: 2020-08-29
Author: peterbell10@live.co.uk
File Name: scipy/spatial/tests/test_distance.py
Class Name: TestPdist
Method Name: test_pdist_out


Project Name: scipy/scipy
Commit Name: b4fe8a68c4a358db8bf734bb630b144c1a4a00ac
Time: 2020-08-29
Author: peterbell10@live.co.uk
File Name: scipy/spatial/tests/test_distance.py
Class Name: TestCdist
Method Name: test_cdist_out


Project Name: scipy/scipy
Commit Name: b4fe8a68c4a358db8bf734bb630b144c1a4a00ac
Time: 2020-08-29
Author: peterbell10@live.co.uk
File Name: scipy/spatial/tests/test_distance.py
Class Name:
Method Name: test_Xdist_non_negative_weights


Project Name: scipy/scipy
Commit Name: b4fe8a68c4a358db8bf734bb630b144c1a4a00ac
Time: 2020-08-29
Author: peterbell10@live.co.uk
File Name: scipy/spatial/tests/test_distance.py
Class Name: TestCdist
Method Name: test_striding


Project Name: scipy/scipy
Commit Name: e5b8e81d2d33823142cc88eed6a5368c8e283a98
Time: 2017-09-13
Author: apbard@users.noreply.github.com
File Name: scipy/spatial/tests/test_distance.py
Class Name:
Method Name: test_modifies_input


Project Name: scipy/scipy
Commit Name: e48f2fb881ca7367eb4c7f86c22c56218c29a3ee
Time: 2017-07-09
Author: sebastian@sipsolutions.net
File Name: scipy/linalg/tests/test_basic.py
Class Name: TestLstsq
Method Name: test_check_finite