Code Duplication    Length = 8-8 lines in 2 locations

metpy/calc/tests/test_tools.py 2 locations

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