Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d3d2f4

Browse files
Merge branch 'iss997_test'
2 parents 764571b + 9fb8c3c commit 7d3d2f4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

-1.87 KB
Loading

lib/matplotlib/tests/test_delaunay.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,20 +193,20 @@ def reference_test():
193193
ref_interpolator = Triangulation([0,10,10,0],
194194
[0,0,10,10]).linear_interpolator([1,10,5,2.0])
195195

196-
def equal_arrays(a1,a2, tolerance=1e-10):
197-
return np.all(np.absolute(a1 - a2) < tolerance)
198-
199196
def test_1d_grid():
200197
res = ref_interpolator[3:6:2j,1:1:1j]
201-
assert equal_arrays(res, [[1.6],[1.9]])
198+
assert np.allclose(res, [[1.6],[1.9]], rtol=0)
202199

203200
def test_0d_grid():
204201
res = ref_interpolator[3:3:1j,1:1:1j]
205-
assert equal_arrays(res, [[1.6]])
202+
assert np.allclose(res, [[1.6]], rtol=0)
206203

207204
@image_comparison(baseline_images=['delaunay-1d-interp'], extensions=['png'])
208205
def test_1d_plots():
209206
x_range = slice(0.25,9.75,20j)
210207
x = np.mgrid[x_range]
208+
ax = plt.gca()
211209
for y in xrange(2,10,2):
212210
plt.plot(x, ref_interpolator[x_range,y:y:1j])
211+
ax.set_xticks([])
212+
ax.set_yticks([])

0 commit comments

Comments
 (0)