예제 #1
0
def test_wrong_dimension_window_apply_window(params):
    """Check that wrong dimension of x causes exception"""
    # Make sure x contains more than one value and then break it.
    assume(len(params["window"]) > 1)
    params["window"] = params["window"][1:]

    with pytest.raises(AssertionError):
        _apply_window(**params)
예제 #2
0
def test_wrong_dimension_ux_apply_window(params):
    """Check that wrong dimension of x causes exception"""
    # Make sure Ux is at least 2x2 and then break it.
    assume(params["Ux"].shape[0] > 1)

    # Cut Ux by one row. Now ux is not square anymore.
    params["Ux"] = params["Ux"][1:]

    with pytest.raises(AssertionError):
        _apply_window(**params)

    # Cut Ux by one column. Now ux is square again but does not match x.
    params["Ux"] = params["Ux"][:, 1:]

    with pytest.raises(AssertionError):
        _apply_window(**params)
예제 #3
0
def test_apply_window_with_known_result(
        known_inputs_and_outputs_for_apply_window):
    """Test one actually known result for apply_window"""
    assert_allclose(
        actual=_apply_window(
            **known_inputs_and_outputs_for_apply_window["inputs"]),
        desired=known_inputs_and_outputs_for_apply_window["outputs"],
    )
예제 #4
0
def test_apply_window(params):
    """Check if application of window to random sample with scalar uncertainty works"""
    assert _apply_window(**params)
예제 #5
0
def test_apply_window(params):
    """Check if application of window to random sample signal works"""
    assert _apply_window(**params)