Open lgarzio opened 2 years ago
Thanks, this is a bug! There was a fix proposed in https://github.com/ioos/ioos_qc/pull/35 but I never extracted the change out from all of the conversion to py2 stuff. I can look at doing so now that you have provided a nice test case.
I am also having trouble with zspan and climatology. In my case, the test isn't working at all if I don't specify zspan. Here's my test code:
cc = qartod.ClimatologyConfig()
cc.add(
vspan=(15, 16), # range of valid values
tspan=("2022-01-01", "2022-02-01"),
zspan=(-100,100)
)
qc_config = {
"climatology_test": {
"config": cc
}
}
qc = QcConfig({'qartod': qc_config})
qc.run( inp=[20], tinp=[pd.to_datetime('2022-01-15')], zinp=[10])
With the zspan
line in the config, the test evaluates (and returns 3). If I comment out the zspan
line, the test does not evaluate (it returns 2).
I am also having trouble with zspan and climatology. In my case, the test isn't working at all if I don't specify zspan. Here's my test code:
cc = qartod.ClimatologyConfig() cc.add( vspan=(15, 16), # range of valid values tspan=("2022-01-01", "2022-02-01"), zspan=(-100,100) ) qc_config = { "climatology_test": { "config": cc } } qc = QcConfig({'qartod': qc_config}) qc.run( inp=[20], tinp=[pd.to_datetime('2022-01-15')], zinp=[10])
With the
zspan
line in the config, the test evaluates (and returns 3). If I comment out thezspan
line, the test does not evaluate (it returns 2).
Ran this example test code with the changes in this PR https://github.com/ioos/ioos_qc/pull/104 and it works now. A value of 3 is returned whether you specify zspan
or not
Still looking into fixing the behavior seen in the original test code.
I'm having an issue with the climatology_test not handling nans if zspan isn't provided. I'm using the latest version of ioos_qc (2.0.1), and according to the ClimatologyConfig documentation, zspan is optional.
This result is incorrect, however if I add zspan to the configuration, it works correctly: