Example #1
0
def test__get_reference_deviation_stdev_bad():
    with pytest.raises(TypeError):
        _ = prediction._get_reference_deviation(
            levels_type="stdev",
            reference_value=42.0,
            stdev=None,
            levels_factor=3.1415,
        )
Example #2
0
def test__get_reference_deviation_absolute():
    factor = 3.1415
    assert prediction._get_reference_deviation(
        levels_type="absolute",
        reference_value=42.0,
        stdev=None,
        levels_factor=factor,
    ) == factor
Example #3
0
def test__get_reference_deviation_relative():
    reference_value = 42.0
    assert prediction._get_reference_deviation(
        levels_type="relative",
        reference_value=reference_value,
        stdev=None,
        levels_factor=3.1415,
    ) == reference_value / 100.0
Example #4
0
def test__get_reference_deviation_stdev_good():
    stdev = 23.0
    assert prediction._get_reference_deviation(
        levels_type="stdev",
        reference_value=42.0,
        stdev=stdev,
        levels_factor=3.1415,
    ) == stdev