Code Duplication    Length = 8-8 lines in 2 locations

metpy/calc/tests/test_tools.py 2 locations

@@ 212-219 (lines=8) @@
209
    assert_array_almost_equal(y_interp[0, :, 0], y_interp_truth, 7)
210
211
212
def test_log_interp_4d():
213
    """Test interpolating with log x-scale 4 dimensions."""
214
    x_log = np.ones((2, 2, 3, 4)) * np.array([1e3, 1e4, 1e5, 1e6])
215
    y_log = np.log(x_log) * 2 + 3
216
    x_interp = np.array([5e3, 5e4, 5e5])
217
    y_interp_truth = np.array([20.0343863828, 24.6395565688, 29.2447267548])
218
    y_interp = log_interp(x_interp, x_log, y_log, axis=3)
219
    assert_array_almost_equal(y_interp[0, 0, 0, :], y_interp_truth, 7)
220
221
222
def test_log_interp_2args():
@@ 202-209 (lines=8) @@
199
    assert_array_almost_equal(y_interp[1], y_interp_truth, 7)
200
201
202
def test_log_interp_3d():
203
    """Test interpolating with log x-scale 3 dimensions along second axis."""
204
    x_log = np.ones((3, 4, 3)) * np.array([1e3, 1e4, 1e5, 1e6]).reshape(-1, 1)
205
    y_log = np.log(x_log) * 2 + 3
206
    x_interp = np.array([5e3, 5e4, 5e5])
207
    y_interp_truth = np.array([20.0343863828, 24.6395565688, 29.2447267548])
208
    y_interp = log_interp(x_interp, x_log, y_log, axis=1)
209
    assert_array_almost_equal(y_interp[0, :, 0], y_interp_truth, 7)
210
211
212
def test_log_interp_4d():