Code Duplication    Length = 19-19 lines in 2 locations

metpy/calc/tests/test_thermo.py 2 locations

@@ 367-385 (lines=19) @@
364
    assert_almost_equal(isentprs[1], truetmp, 3)
365
366
367
def test_isentropic_pressure_p_increase_rh_out():
368
    """Test calculation of isentropic pressure function, p increasing order."""
369
    lev = [85000., 90000., 95000., 100000.] * units.Pa
370
    tmp = np.ones((4, 5, 5))
371
    tmp[0, :] = 288.
372
    tmp[1, :] = 290.
373
    tmp[2, :] = 292.
374
    tmp[3, :] = 296.
375
    tmpk = tmp * units.kelvin
376
    rh = np.ones((4, 5, 5))
377
    rh[0, :] = 20.
378
    rh[1, :] = 40.
379
    rh[2, :] = 80.
380
    rh[3, :] = 100.
381
    relh = rh * units.percent
382
    isentlev = [296.] * units.kelvin
383
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk, relh)
384
    truerh = 100. * units.percent
385
    assert_almost_equal(isentprs[1], truerh, 3)
386
@@ 331-349 (lines=19) @@
328
    assert_almost_equal(isentprs[0], trueprs, 3)
329
330
331
def test_isentropic_pressure_adition_args():
332
    """Test calculation of isentropic pressure function, additional args."""
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
    rh = np.ones((4, 5, 5))
340
    rh[0, :] = 100.
341
    rh[1, :] = 80.
342
    rh[2, :] = 40.
343
    rh[3, :] = 20.
344
    relh = rh * units.percent
345
    tmpk = tmp * units.kelvin
346
    isentlev = [296.] * units.kelvin
347
    isentprs = get_isentropic_pressure(isentlev, lev, tmpk, relh)
348
    truerh = 100. * units.percent
349
    assert_almost_equal(isentprs[1], truerh, 3)
350
351
352
def test_isentropic_pressure_tmp_out():