b99f8008ddce64d6389ca7fbda1638a8ded5ac74,scipy/spatial/tests/test_distance.py,TestPdist,test_pdist_out,#TestPdist#,1344
Before Change
eps = 1e-07
for metric in _METRICS_NAMES:
for rnd_eo_name in self.rnd_eo_names:
kwargs = {"p": None, "w": None, "V": None, "VI": None,
"out": None}
if metric in ["minkowski", "wminkowski"]:
kwargs["p"] = 1.23
X = eo[rnd_eo_name]
if metric == "wminkowski":
kwargs["w"] = 1.0 / X.std(axis=0)
out1 = np.empty(4950, dtype=np.double)
Y_right = pdist(X, metric, **kwargs)
kwargs["out"] = out1
Y_test1 = pdist(X, metric, **kwargs)
// test that output is numerically equivalent
_assert_within_tol(Y_test1, Y_right, eps)
// test that Y_test1 and out1 are the same object
assert_(Y_test1 is out1)
// test incorrect shape
out2 = np.empty(495, dtype=np.double)
kwargs["out"] = out2
assert_raises(ValueError, pdist, X, metric, **kwargs)
// test for (C-)contiguous output
out3 = np.empty(49500, dtype=np.double)[::10]
kwargs["out"] = out3
assert_raises(ValueError, pdist, X, metric, **kwargs)
// test for incorrect dtype
out5 = np.empty(4950, dtype=np.int64)
kwargs["out"] = out5
assert_raises(ValueError, pdist, X, metric, **kwargs)
class TestSomeDistanceFunctions(object):
After Change
X = eo["random-float32-data"][::5, ::2]
out_size = int((X.shape[0] * (X.shape[0] - 1)) / 2)
for metric in _METRICS_NAMES:
kwargs = dict()
if metric in ["minkowski", "wminkowski"]:
kwargs["p"] = 1.23
if metric == "wminkowski":
kwargs["w"] = 1.0 / X.std(axis=0)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 12
Instances
Project Name: scipy/scipy
Commit Name: b99f8008ddce64d6389ca7fbda1638a8ded5ac74
Time: 2017-09-14
Author: apbard@users.noreply.github.com
File Name: scipy/spatial/tests/test_distance.py
Class Name: TestPdist
Method Name: test_pdist_out
Project Name: scipy/scipy
Commit Name: b99f8008ddce64d6389ca7fbda1638a8ded5ac74
Time: 2017-09-14
Author: apbard@users.noreply.github.com
File Name: scipy/spatial/tests/test_distance.py
Class Name: TestCdist
Method Name: test_cdist_out
Project Name: scipy/scipy
Commit Name: b99f8008ddce64d6389ca7fbda1638a8ded5ac74
Time: 2017-09-14
Author: apbard@users.noreply.github.com
File Name: scipy/spatial/tests/test_distance.py
Class Name: TestPdist
Method Name: test_pdist_out
Project Name: merenlab/anvio
Commit Name: bb21b3314c57ec4208af8eed8041091cc51ec68a
Time: 2020-02-26
Author: kiefl.evan@gmail.com
File Name: anvio/profiler.py
Class Name: BAMProfiler
Method Name: generate_variabile_codons_table