예제 #1
0
def test_calc_prcp_isohs_none(short_daily_dataframe):
    m = MtClim(data=short_daily_dataframe,
               parameters={
                   'site_isoh': None,
                   'base_isoh': None
               })
    m.calc_prcp()
예제 #2
0
def test_calc_srad_humidity_iterative(short_daily_dataframe):
    m = MtClim(data=short_daily_dataframe)
    m.calc_tair()
    m.calc_prcp()
    m.snowpack()
    assert (m.data['s_swe'] >= 0.).all()
    m.calc_srad_humidity_iterative()
예제 #3
0
def test_calc_prcp_catch_single_isoh(short_daily_dataframe):
    m = MtClim(data=short_daily_dataframe,
               parameters={
                   'site_isoh': None,
                   'base_isoh': 43
               })
    with pytest.raises(ValueError):
        m.calc_prcp()
예제 #4
0
def test_simple_snowpack(short_daily_dataframe):
    m = MtClim(data=short_daily_dataframe)
    m.calc_tair()
    m.calc_prcp()
    m.data['s_swe'] = 0.
    m._simple_snowpack(0.)
    assert (m.data['s_swe'] >= 0.).all()
    m.data['s_swe'] = 0.
    m._simple_snowpack(100)
    assert (m.data['s_swe'] >= 0.).all()