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

removed variable wildcard support

parent 04f72c5d
No related branches found
No related tags found
1 merge request!14WIP: Expose the function parameter 'field' to the config
Pipeline #2519 passed with stage
in 7 minutes and 4 seconds
......@@ -68,21 +68,20 @@ yield 'publication-ready' results
| `x` | `constant(window="3h")` | True |
| `y` | `range(min=-10, max=40)` | |
### Wildcards
### Regular Expressions
Some of the most basic tests (e.g. checks for missing values or range tests) but
also the more elaborated functions available (e.g. aggregation or interpolation
functions) are very likely to be used on all or at least several variables of
the processed dataset. As it becomes quite cumbersome to list all these
variables seperately, only to call the same functions with the same
parameters over and over again, SaQC supports wildcards and regular expressions
parameters over and over again, SaQC supports regular expressions
within the `varname` column.
| varname | test |
|--------------|--------------------------------------|
| * | `harmonize_shift2Grid(freq="15Min")` |
| .* | `harmonize_shift2Grid(freq="15Min")` |
| (x | y) | `missing()` |
#### Bring it to a file
As mentioned above SaQC, expectd the configuration to be a table-like,
semicolon-separated text file. So the configuration from the
......
......@@ -81,8 +81,6 @@ def _expandVarnameWildcards(config: ConfigList, data: pd.DataFrame) -> ConfigLis
for row in config:
varname = row[F.VARNAME]
if varname and varname not in data:
if varname == "*":
varname = ".*"
expansion = data.columns[data.columns.str.match(varname)]
if not len(expansion):
expansion = [varname]
......
......@@ -41,10 +41,9 @@ def test_configPreparation(data):
assert result == expected
def test_variableWildcards(data):
def test_variableRegex(data):
tests = [
("*", ".*"),
(".*", ".*"),
("var(1|2)", "var(1|2)"),
("(.*3)", "(.*3)")
......
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