Code Duplication    Length = 19-19 lines in 2 locations

metpy/calc/tests/test_thermo.py 2 locations

@@ 373-391 (lines=19) @@
370
    assert_almost_equal(isentprs[1], truetmp, 3)
371
372
373
def test_isentropic_pressure_p_increase_rh_out():
374
    """Test calculation of isentropic pressure function, p increasing order."""
375
    lev = [85000., 90000., 95000., 100000.] * units.Pa
376
    tmp = np.ones((4, 5, 5))
377
    tmp[0, :] = 288.
378
    tmp[1, :] = 290.
379
    tmp[2, :] = 292.
380
    tmp[3, :] = 296.
381
    tmpk = tmp * units.kelvin
382
    rh = np.ones((4, 5, 5))
383
    rh[0, :] = 20.
384
    rh[1, :] = 40.
385
    rh[2, :] = 80.
386
    rh[3, :] = 100.
387
    relh = rh * units.percent
388
    isentlev = [296.] * units.kelvin
389
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk, relh)
390
    truerh = 100. * units.percent
391
    assert_almost_equal(isentprs[1], truerh, 3)
392
393
394
def test_rh_mixing_ratio():
@@ 337-355 (lines=19) @@
334
    assert_almost_equal(isentprs[0], trueprs, 3)
335
336
337
def test_isentropic_pressure_adition_args():
338
    """Test calculation of isentropic pressure function, additional args."""
339
    lev = [100000., 95000., 90000., 85000.] * units.Pa
340
    tmp = np.ones((4, 5, 5))
341
    tmp[0, :] = 296.
342
    tmp[1, :] = 292.
343
    tmp[2, :] = 290.
344
    tmp[3, :] = 288.
345
    rh = np.ones((4, 5, 5))
346
    rh[0, :] = 100.
347
    rh[1, :] = 80.
348
    rh[2, :] = 40.
349
    rh[3, :] = 20.
350
    relh = rh * units.percent
351
    tmpk = tmp * units.kelvin
352
    isentlev = [296.] * units.kelvin
353
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk, relh)
354
    truerh = 100. * units.percent
355
    assert_almost_equal(isentprs[1], truerh, 3)
356
357
358
def test_isentropic_pressure_tmp_out():