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

Merge branch 'bugfixes' into 'master'

Bugfixes

See merge request !11
parents a6c875f1 300238ca
No related branches found
No related tags found
1 merge request!11Bugfixes
Pipeline #2416 passed with stage
in 6 minutes and 35 seconds
......@@ -6,7 +6,7 @@ class Fields:
VARNAME = "varname"
START = "start_date"
END = "end_date"
TESTS = "test*"
TESTS = "test"
PLOT = "plot"
LINENUMBER = "line"
......
......@@ -88,7 +88,7 @@ def run(
config = readConfig(config_file, data)
# split config into the test and some 'meta' data
tests = config.filter(regex=Fields.TESTS)
tests = config.filter(regex=Fields.TESTS + '*')
meta = config[config.columns.difference(tests.columns)]
# prepapre the flags
......
......@@ -125,7 +125,7 @@ def checkConfig(config_df: pd.DataFrame, data: pd.DataFrame, flagger: BaseFlagge
if pd.isnull(config_row[F.VARNAME]) or not var_name:
_raise(config_row, SyntaxError, f"non-optional column '{F.VARNAME}' is missing or empty")
test_fields = config_row.filter(regex=F.TESTS).dropna()
test_fields = config_row.filter(regex=F.TESTS + '*').dropna()
if test_fields.empty:
_raise(
config_row, SyntaxError, f"at least one test needs to be given for variable",
......
......@@ -22,9 +22,9 @@ def flagConstant(data, field, flagger, thresh, window, **kwargs):
"""
d = data[field]
# find all constant values in forward search
# find all constant values in a row with a forward search
r = d.rolling(window=window)
mask = (r.max() - r.min()) <= thresh
mask = (r.max() - r.min() <= thresh) & (r.count() > 1)
# backward rolling for offset windows hack
bw = mask[::-1].copy()
......
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