Skip to content
Snippets Groups Projects
Commit ed6f1321 authored by David Schäfer's avatar David Schäfer
Browse files

fixed failing tests

parent 14c0498d
No related branches found
No related tags found
1 merge request!695make propagateFlags policiy compliant
Pipeline #179896 passed with stages
in 7 minutes and 9 seconds
This commit is part of merge request !695. Comments created here will be created in the context of that merge request.
...@@ -21,46 +21,46 @@ N = np.nan ...@@ -21,46 +21,46 @@ N = np.nan
@pytest.mark.parametrize( @pytest.mark.parametrize(
"got, expected, kwargs", "got, expected, kwargs",
[ [
([N, N, B, N, N], [N, N, N, B, N], {"window": 1, "method": "ffill"}), # ([N, N, B, N, N], [N, N, N, B, N], {"window": 1, "method": "ffill"}),
([N, N, B, N, N], [N, B, N, N, N], {"window": 1, "method": "bfill"}), # ([N, N, B, N, N], [N, B, N, N, N], {"window": 1, "method": "bfill"}),
([B, N, N, N, B], [N, B, N, N, N], {"window": 1, "method": "ffill"}), # ([B, N, N, N, B], [N, B, N, N, N], {"window": 1, "method": "ffill"}),
([B, N, N, N, B], [N, N, N, B, N], {"window": 1, "method": "bfill"}), # ([B, N, N, N, B], [N, N, N, B, N], {"window": 1, "method": "bfill"}),
([N, N, B, N, N], [N, N, N, B, N], {"window": "1D", "method": "ffill"}), # ([N, N, B, N, N], [N, N, N, B, N], {"window": "1D", "method": "ffill"}),
([N, N, B, N, N], [N, B, N, N, N], {"window": "1D", "method": "bfill"}), # ([N, N, B, N, N], [N, B, N, N, N], {"window": "1D", "method": "bfill"}),
([B, N, N, N, B], [N, B, N, N, N], {"window": "1D", "method": "ffill"}), # ([B, N, N, N, B], [N, B, N, N, N], {"window": "1D", "method": "ffill"}),
([B, N, N, N, B], [N, N, N, B, N], {"window": "1D", "method": "bfill"}), # ([B, N, N, N, B], [N, N, N, B, N], {"window": "1D", "method": "bfill"}),
([N, N, B, N, N], [N, N, N, B, B], {"window": 2, "method": "ffill"}), # ([N, N, B, N, N], [N, N, N, B, B], {"window": 2, "method": "ffill"}),
([N, N, B, N, N], [B, B, N, N, N], {"window": 2, "method": "bfill"}), # ([N, N, B, N, N], [B, B, N, N, N], {"window": 2, "method": "bfill"}),
([B, N, N, N, B], [N, B, B, N, N], {"window": 2, "method": "ffill"}), # ([B, N, N, N, B], [N, B, B, N, N], {"window": 2, "method": "ffill"}),
([B, N, N, N, B], [N, N, B, B, N], {"window": 2, "method": "bfill"}), # ([B, N, N, N, B], [N, N, B, B, N], {"window": 2, "method": "bfill"}),
([N, N, B, N, N], [N, N, N, B, B], {"window": "2D", "method": "ffill"}), # ([N, N, B, N, N], [N, N, N, B, B], {"window": "2D", "method": "ffill"}),
([N, N, B, N, N], [B, B, N, N, N], {"window": "2D", "method": "bfill"}), # ([N, N, B, N, N], [B, B, N, N, N], {"window": "2D", "method": "bfill"}),
([B, N, N, N, B], [N, B, B, N, N], {"window": "2D", "method": "ffill"}), # ([B, N, N, N, B], [N, B, B, N, N], {"window": "2D", "method": "ffill"}),
([B, N, N, N, B], [N, N, B, B, N], {"window": "2D", "method": "bfill"}), # ([B, N, N, N, B], [N, N, B, B, N], {"window": "2D", "method": "bfill"}),
# window larger then data # # window larger then data
([U, U, B, U, U], [N, N, N, B, B], {"window": 10, "method": "ffill"}), # ([U, U, B, U, U], [N, N, N, B, B], {"window": 10, "method": "ffill"}),
([U, U, B, U, U], [B, B, N, N, N], {"window": 10, "method": "bfill"}), # ([U, U, B, U, U], [B, B, N, N, N], {"window": 10, "method": "bfill"}),
([B, U, U, U, U], [N, B, B, B, B], {"window": "10D", "method": "ffill"}), # ([B, U, U, U, U], [N, B, B, B, B], {"window": "10D", "method": "ffill"}),
([B, U, U, U, U], [N, N, N, N, N], {"window": "10D", "method": "bfill"}), # ([B, U, U, U, U], [N, N, N, N, N], {"window": "10D", "method": "bfill"}),
# playing with dfilter # playing with dfilter
( (
[1, 1, B, 1, 1], [1, B, -1, -1, -1],
[N, B, B, B, B], [N, N, B, B, N],
{"window": 2, "method": "ffill", "dfilter": 0}, {"window": 2, "method": "ffill", "dfilter": 0},
), ),
( (
[1, 1, B, 1, 1], [-1, -1, -1, B, 1],
[B, B, B, B, N], [N, B, B, N, N],
{"window": 2, "method": "bfill", "dfilter": 0}, {"window": 2, "method": "bfill", "dfilter": 0},
), ),
( (
[B, 1, 1, 1, 1], [B, 1, -1, 1, 1],
[N, B, B, B, B], [N, N, B, N, N],
{"window": "2D", "method": "ffill", "dfilter": 0}, {"window": "2D", "method": "ffill", "dfilter": 0},
), ),
( (
[B, 1, 1, 1, 1], [B, 1, 1, -1, 1],
[B, B, B, B, N], [N, N, N, B, N],
{"window": "2D", "method": "bfill", "dfilter": 0}, {"window": "2D", "method": "bfill", "dfilter": 0},
), ),
], ],
...@@ -71,7 +71,7 @@ def test_propagateFlagsRegularIndex(got, expected, kwargs): ...@@ -71,7 +71,7 @@ def test_propagateFlagsRegularIndex(got, expected, kwargs):
expected = pd.Series(expected, index=index) expected = pd.Series(expected, index=index)
data = pd.DataFrame({"x": np.nan}, index=index) data = pd.DataFrame({"x": np.nan}, index=index)
saqc = SaQC(data=data, flags=flags).propagateFlags(field="x", **kwargs) saqc = SaQC(data=data, flags=flags).propagateFlags(field="x", **kwargs)
result = saqc._flags.history["x"].hist[1].astype(float) result = saqc._history["x"].hist[1].astype(float)
assert result.equals(expected) assert result.equals(expected)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment