Code Duplication    Length = 13-13 lines in 3 locations

metpy/calc/tests/test_thermo.py 3 locations

@@ 357-369 (lines=13) @@
354
    assert_almost_equal(isentprs[1], truerh, 3)
355
356
357
def test_isentropic_pressure_tmp_out():
358
    """Test calculation of isentropic pressure function, temperature output."""
359
    lev = [100000., 95000., 90000., 85000.] * units.Pa
360
    tmp = np.ones((4, 5, 5))
361
    tmp[0, :] = 296.
362
    tmp[1, :] = 292.
363
    tmp[2, :] = 290.
364
    tmp[3, :] = 288.
365
    tmpk = tmp * units.kelvin
366
    isentlev = [296.] * units.kelvin
367
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk, tmpk_out=True)
368
    truetmp = 296. * units.kelvin
369
    assert_almost_equal(isentprs[1], truetmp, 3)
370
371
372
def test_isentropic_pressure_p_increase_rh_out():
@@ 321-333 (lines=13) @@
318
    assert_almost_equal(isentprs[0], trueprs, 3)
319
320
321
def test_isentropic_pressure_p_increase():
322
    """Test calculation of isentropic pressure function, p increasing order."""
323
    lev = [85000, 90000., 95000., 100000.] * units.Pa
324
    tmp = np.ones((4, 5, 5))
325
    tmp[0, :] = 288.
326
    tmp[1, :] = 290.
327
    tmp[2, :] = 292.
328
    tmp[3, :] = 296.
329
    tmpk = tmp * units.kelvin
330
    isentlev = [296.] * units.kelvin
331
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk)
332
    trueprs = 1000. * units.hPa
333
    assert_almost_equal(isentprs[0], trueprs, 3)
334
335
336
def test_isentropic_pressure_adition_args():
@@ 306-318 (lines=13) @@
303
    assert_almost_equal(psychrometric_rh, 82.9701 * units.percent, 3)
304
305
306
def test_isentropic_pressure():
307
    """Test calculation of isentropic pressure function."""
308
    lev = [100000., 95000., 90000., 85000.] * units.Pa
309
    tmp = np.ones((4, 5, 5))
310
    tmp[0, :] = 296.
311
    tmp[1, :] = 292.
312
    tmp[2, :] = 290
313
    tmp[3, :] = 288.
314
    tmpk = tmp * units.kelvin
315
    isentlev = [296.] * units.kelvin
316
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk)
317
    trueprs = 1000. * units.hPa
318
    assert_almost_equal(isentprs[0], trueprs, 3)
319
320
321
def test_isentropic_pressure_p_increase():