Code Duplication    Length = 19-19 lines in 2 locations

metpy/calc/tests/test_thermo.py 2 locations

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