How to use the pymannkendall.seasonal_test function in pymannkendall

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
def test_seasonal_test(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.seasonal_test(NoTrendData, period=12)
    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.seasonal_test(TrendData, period=12)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 5220.0
    
    # check with arbitrary data
github mmhs013 / pyMannKendall / tests / test_pymannkendall.py View on Github external
def test_seasonal_test(NoTrendData, TrendData, arbitrary_1d_data):
    # check with no trend data
    NoTrendRes = mk.seasonal_test(NoTrendData, period=12)
    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.seasonal_test(TrendData, period=12)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 5220.0
    
    # check with arbitrary data
    result = mk.seasonal_test(arbitrary_1d_data, period=12)
    assert result.trend == 'decreasing'
    assert result.h == True
    assert result.p == 0.03263834596177739
    assert result.z == -2.136504114534638
    assert result.Tau == -0.0794979079497908
    assert result.s == -399.0
    assert result.var_s == 34702.333333333336
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.seasonal_test(TrendData, period=12)
    assert TrendRes.trend == 'increasing'
    assert TrendRes.h == True
    assert TrendRes.p == 0.0
    assert TrendRes.Tau == 1.0
    assert TrendRes.s == 5220.0
    
    # check with arbitrary data
    result = mk.seasonal_test(arbitrary_1d_data, period=12)
    assert result.trend == 'decreasing'
    assert result.h == True
    assert result.p == 0.03263834596177739
    assert result.z == -2.136504114534638
    assert result.Tau == -0.0794979079497908
    assert result.s == -399.0
    assert result.var_s == 34702.333333333336