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
@@ 316-328 (lines=13) @@
313
    assert_almost_equal(isentprs[0], trueprs, 3)
314
315
316
def test_isentropic_pressure_p_increase():
317
    """Test calculation of isentropic pressure function, p increasing order."""
318
    lev = [85000, 90000., 95000., 100000.] * units.Pa
319
    tmp = np.ones((4, 5, 5))
320
    tmp[0, :] = 288.
321
    tmp[1, :] = 290.
322
    tmp[2, :] = 292.
323
    tmp[3, :] = 296.
324
    tmpk = tmp * units.kelvin
325
    isentlev = [296.] * units.kelvin
326
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk)
327
    trueprs = 1000. * units.hPa
328
    assert_almost_equal(isentprs[0], trueprs, 3)
329
330
331
def test_isentropic_pressure_adition_args():
@@ 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 = [100000., 95000., 90000., 85000.] * units.Pa
304
    tmp = np.ones((4, 5, 5))
305
    tmp[0, :] = 296.
306
    tmp[1, :] = 292.
307
    tmp[2, :] = 290.
308
    tmp[3, :] = 288.
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():