Code Duplication    Length = 8-8 lines in 2 locations

metpy/calc/tests/test_tools.py 2 locations

@@ 334-341 (lines=8) @@
331
    assert_array_almost_equal(y_interp[0, :, 0], y_interp_truth, 7)
332
333
334
def test_log_interp_4d():
335
    """Test interpolating with log x-scale 4 dimensions."""
336
    x_log = np.ones((2, 2, 3, 4)) * np.array([1e3, 1e4, 1e5, 1e6])
337
    y_log = np.log(x_log) * 2 + 3
338
    x_interp = np.array([5e3, 5e4, 5e5])
339
    y_interp_truth = np.array([20.0343863828, 24.6395565688, 29.2447267548])
340
    y_interp = log_interp(x_interp, x_log, y_log, axis=3)
341
    assert_array_almost_equal(y_interp[0, 0, 0, :], y_interp_truth, 7)
342
343
344
def test_log_interp_2args():
@@ 324-331 (lines=8) @@
321
    assert_array_almost_equal(y_interp[1], y_interp_truth, 7)
322
323
324
def test_log_interp_3d():
325
    """Test interpolating with log x-scale 3 dimensions along second axis."""
326
    x_log = np.ones((3, 4, 3)) * np.array([1e3, 1e4, 1e5, 1e6]).reshape(-1, 1)
327
    y_log = np.log(x_log) * 2 + 3
328
    x_interp = np.array([5e3, 5e4, 5e5])
329
    y_interp_truth = np.array([20.0343863828, 24.6395565688, 29.2447267548])
330
    y_interp = log_interp(x_interp, x_log, y_log, axis=1)
331
    assert_array_almost_equal(y_interp[0, :, 0], y_interp_truth, 7)
332
333
334
def test_log_interp_4d():