Code Duplication    Length = 13-13 lines in 3 locations

metpy/calc/tests/test_thermo.py 3 locations

@@ 352-364 (lines=13) @@
349
    assert_almost_equal(isentprs[1], truerh, 3)
350
351
352
def test_isentropic_pressure_tmp_out():
353
    """Test calculation of isentropic pressure function, temperature output."""
354
    lev = [100000., 95000., 90000., 85000.] * units.Pa
355
    tmp = np.ones((4, 5, 5))
356
    tmp[0, :] = 296.
357
    tmp[1, :] = 292.
358
    tmp[2, :] = 290.
359
    tmp[3, :] = 288.
360
    tmpk = tmp * units.kelvin
361
    isentlev = [296.] * units.kelvin
362
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk, tmpk_out=True)
363
    truetmp = 296. * units.kelvin
364
    assert_almost_equal(isentprs[1], truetmp, 3)
365
366
367
def test_isentropic_pressure_p_increase_rh_out():
@@ 301-313 (lines=13) @@
298
    assert_almost_equal(psychrometric_rh, 82.9701 * units.percent, 3)
299
300
301
def test_isentropic_pressure():
302
    """Test calculation of isentropic pressure function."""
303
    lev = [1000., 975., 950., 925.] * units.hPa
304
    tmp = np.ones((4, 5, 5))
305
    tmp[0, :] = 296.
306
    tmp[1, :] = 292.
307
    tmp[2, :] = 285.783059
308
    tmp[3, :] = 280.
309
    tmpk = tmp * units.kelvin
310
    isentlev = [296.] * units.kelvin
311
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk)
312
    trueprs = 1000. * units.hPa
313
    assert_almost_equal(isentprs[0], trueprs, 3)
314
315
316
def test_isentropic_pressure_p_increase():
@@ 301-313 (lines=13) @@
298
    assert_almost_equal(psychrometric_rh, 82.9701 * units.percent, 3)
299
300
301
def test_isentropic_pressure():
302
    """Test calculation of isentropic pressure function."""
303
    lev = [1000., 975., 950., 925.] * units.hPa
304
    tmp = np.ones((4, 5, 5))
305
    tmp[0, :] = 296.
306
    tmp[1, :] = 292.
307
    tmp[2, :] = 285.783059
308
    tmp[3, :] = 280.
309
    tmpk = tmp * units.kelvin
310
    isentlev = [296.] * units.kelvin
311
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk)
312
    trueprs = 1000. * units.hPa
313
    assert_almost_equal(isentprs[0], trueprs, 3)
314
315
316
def test_isentropic_pressure_p_increase():