Code Duplication    Length = 8-8 lines in 2 locations

metpy/calc/tests/test_thermo.py 2 locations

@@ 193-200 (lines=8) @@
190
    assert lfc_temperature is None
191
192
193
def test_lfc_inversion():
194
    """Test LFC when there is an inversion to be sure we don't pick that."""
195
    levels = np.array([963., 902., 830., 815., 810.8, 802., 789., 700., 571., 450., 300., 248.]) * units.mbar
196
    temperatures = np.array([25.4, 19.4, 14.8, 13.6, 15.3, 18.8, 18.4, 10., -3.9, -16.3, -41.1, -51.5]) * units.celsius
197
    dewpoints = np.array([20.4, 18.7, 11.8, -1.4, -0.1, 2.8, 0.4, -9., -23.9, -33.3, -54.1, -63.5]) * units.celsius
198
    l = lfc(levels, temperatures, dewpoints)
199
    assert_almost_equal(l[0], 706.8909 * units.mbar, 2)
200
    assert_almost_equal(l[1], 10.6503 * units.celsius, 2)
201
202
203
def test_saturation_mixing_ratio():
@@ 173-180 (lines=8) @@
170
        lcl(1000. * units.mbar, 30. * units.degC, 20. * units.degC, max_iters=2)
171
172
173
def test_lfc_basic():
174
    """Test LFC calculation."""
175
    levels = np.array([959., 779.2, 751.3, 724.3, 700., 269.]) * units.mbar
176
    temperatures = np.array([22.2, 14.6, 12., 9.4, 7., -49.]) * units.celsius
177
    dewpoints = np.array([19., -11.2, -10.8, -10.4, -10., -53.2]) * units.celsius
178
    l = lfc(levels, temperatures, dewpoints)
179
    assert_almost_equal(l[0], 727.468 * units.mbar, 2)
180
    assert_almost_equal(l[1], 9.705 * units.celsius, 2)
181
182
183
def test_no_lfc():