Code Duplication    Length = 13-13 lines in 3 locations

metpy/calc/tests/test_thermo.py 3 locations

@@ 382-394 (lines=13) @@
379
    assert_almost_equal(isentprs[1], truerh, 3)
380
381
382
def test_isentropic_pressure_tmp_out():
383
    """Test calculation of isentropic pressure function, temperature output."""
384
    lev = [100000., 95000., 90000., 85000.] * units.Pa
385
    tmp = np.ones((4, 5, 5))
386
    tmp[0, :] = 296.
387
    tmp[1, :] = 292.
388
    tmp[2, :] = 290.
389
    tmp[3, :] = 288.
390
    tmpk = tmp * units.kelvin
391
    isentlev = [296.] * units.kelvin
392
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk, tmpk_out=True)
393
    truetmp = 296. * units.kelvin
394
    assert_almost_equal(isentprs[1], truetmp, 3)
395
396
397
def test_isentropic_pressure_p_increase_rh_out():
@@ 346-358 (lines=13) @@
343
    assert_almost_equal(isentprs[0], trueprs, 3)
344
345
346
def test_isentropic_pressure_p_increase():
347
    """Test calculation of isentropic pressure function, p increasing order."""
348
    lev = [85000, 90000., 95000., 100000.] * units.Pa
349
    tmp = np.ones((4, 5, 5))
350
    tmp[0, :] = 288.
351
    tmp[1, :] = 290.
352
    tmp[2, :] = 292.
353
    tmp[3, :] = 296.
354
    tmpk = tmp * units.kelvin
355
    isentlev = [296.] * units.kelvin
356
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk)
357
    trueprs = 1000. * units.hPa
358
    assert_almost_equal(isentprs[0], trueprs, 3)
359
360
361
def test_isentropic_pressure_adition_args():
@@ 331-343 (lines=13) @@
328
    assert_almost_equal(rh, 82.7145 * units.percent, 3)
329
330
331
def test_isentropic_pressure():
332
    """Test calculation of isentropic pressure function."""
333
    lev = [100000., 95000., 90000., 85000.] * units.Pa
334
    tmp = np.ones((4, 5, 5))
335
    tmp[0, :] = 296.
336
    tmp[1, :] = 292.
337
    tmp[2, :] = 290
338
    tmp[3, :] = 288.
339
    tmpk = tmp * units.kelvin
340
    isentlev = [296.] * units.kelvin
341
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk)
342
    trueprs = 1000. * units.hPa
343
    assert_almost_equal(isentprs[0], trueprs, 3)
344
345
346
def test_isentropic_pressure_p_increase():