How to use pymannkendall - 10 common examples

To help you get started, we’ve selected a few pymannkendall examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.hamed_rao_modification_test(TrendData, lag=3)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
    result = mk.hamed_rao_modification_test(arbitrary_1d_data, lag=3)
    assert result.trend == 'no trend'
    assert result.h == False
    assert result.p == 0.6037112685123898
    assert result.z == -0.5190709455046154
    assert result.Tau == -0.03153167653875869
    assert result.s == -1959.0
    assert result.var_s == 14228919.889368296
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
def test_hamed_rao_modification_test(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.hamed_rao_modification_test(NoTrendData)
    assert NoTrendRes.trend == 'no trend'
    assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.hamed_rao_modification_test(TrendData)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
def test_hamed_rao_modification_test_lag3(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.hamed_rao_modification_test(NoTrendData, lag=3)
    assert NoTrendRes.trend == 'no trend'
    assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.hamed_rao_modification_test(TrendData, lag=3)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
    result = mk.hamed_rao_modification_test(arbitrary_1d_data, lag=3)
    assert result.trend == 'no trend'
    assert result.h == False
    assert result.p == 0.6037112685123898
    assert result.z == -0.5190709455046154
    assert result.Tau == -0.03153167653875869
    assert result.s == -1959.0
    assert result.var_s == 14228919.889368296
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
def test_hamed_rao_modification_test(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.hamed_rao_modification_test(NoTrendData)
    assert NoTrendRes.trend == 'no trend'
    assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.hamed_rao_modification_test(TrendData)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
    result = mk.hamed_rao_modification_test(arbitrary_1d_data)
    assert result.trend == 'decreasing'
    assert result.h == True
    assert result.p == 0.00012203829241275166
    assert result.z == -3.8419950613710894
    assert result.Tau == -0.03153167653875869
    assert result.s == -1959.0
    assert result.var_s == 259723.81316716125
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
def test_hamed_rao_modification_test_lag3(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.hamed_rao_modification_test(NoTrendData, lag=3)
    assert NoTrendRes.trend == 'no trend'
    assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.hamed_rao_modification_test(TrendData, lag=3)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.hamed_rao_modification_test(TrendData)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
    result = mk.hamed_rao_modification_test(arbitrary_1d_data)
    assert result.trend == 'decreasing'
    assert result.h == True
    assert result.p == 0.00012203829241275166
    assert result.z == -3.8419950613710894
    assert result.Tau == -0.03153167653875869
    assert result.s == -1959.0
    assert result.var_s == 259723.81316716125
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
def test_yue_wang_modification_test(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.yue_wang_modification_test(NoTrendData)
    assert NoTrendRes.trend == 'no trend'
    assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.yue_wang_modification_test(TrendData)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
def test_yue_wang_modification_test(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.yue_wang_modification_test(NoTrendData)
    assert NoTrendRes.trend == 'no trend'
    assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.yue_wang_modification_test(TrendData)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
    result = mk.yue_wang_modification_test(arbitrary_1d_data)
    assert result.trend == 'decreasing'
    assert result.h == True
    np.testing.assert_allclose(result.p, 0.008401398144858296)
    np.testing.assert_allclose(result.z, -2.6354977553857504)
    assert result.Tau == -0.03153167653875869
    assert result.s == -1959.0
    np.testing.assert_allclose(result.var_s, 551950.4269211816)
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
def test_yue_wang_modification_test_lag1(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.yue_wang_modification_test(NoTrendData, lag=1)
    assert NoTrendRes.trend == 'no trend'
    assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.yue_wang_modification_test(TrendData, lag=1)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
    result = mk.yue_wang_modification_test(arbitrary_1d_data, lag=1)
    assert result.trend == 'no trend'
    assert result.h == False
    np.testing.assert_allclose(result.p, 0.5433112864060043)
    np.testing.assert_allclose(result.z, -0.6078133313683783)
    assert result.Tau == -0.03153167653875869
    assert result.s == -1959.0
    np.testing.assert_allclose(result.var_s, 10377313.384506395)
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
assert NoTrendRes.h == False
    assert NoTrendRes.p == 1.0
    assert NoTrendRes.z == 0
    assert NoTrendRes.Tau == 0.0
    assert NoTrendRes.s == 0.0
    
    # check with trendy data
    TrendRes = mk.yue_wang_modification_test(TrendData)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 64620.0
    
    # check with arbitrary data
    result = mk.yue_wang_modification_test(arbitrary_1d_data)
    assert result.trend == 'decreasing'
    assert result.h == True
    np.testing.assert_allclose(result.p, 0.008401398144858296)
    np.testing.assert_allclose(result.z, -2.6354977553857504)
    assert result.Tau == -0.03153167653875869
    assert result.s == -1959.0
    np.testing.assert_allclose(result.var_s, 551950.4269211816)