dtcenter / MET

Model Evaluation Tools
https://dtcenter.org/community-code/model-evaluation-tools-met
Apache License 2.0
77 stars 24 forks source link

Bugfix #2897 develop python_valid_time #2899

Closed JohnHalleyGotway closed 4 months ago

JohnHalleyGotway commented 4 months ago

Note that this bug in Point-Stat and Ensemble-Stat occurs when reading point observations through Python embedding. If some of the obs share a common valid time, then there is a mismatch in the unique list of numeric valid times and the non-unique list of valid time strings.

Expected Differences

Pull Request Testing

Pull Request Checklist

See the METplus Workflow for details.

DanielAdriaansen commented 4 months ago

@JohnHalleyGotway thanks for making this fix, I will test it shortly.

Regarding asking for additional debugging that would have helped, I think it's worthwhile to consider adding a high DEBUG option (10? 10+?) to print the "header" (an entire row of the 11-column data) for each of these rejection types: https://github.com/dtcenter/MET/blob/16aac923a8db931cf99e6a24ed6ae275b4a664d8/src/libcode/vx_statistics/pair_data_point.cc#L424-L430

In debugging I actually added some print statements here: https://github.com/dtcenter/MET/blob/16aac923a8db931cf99e6a24ed6ae275b4a664d8/src/libcode/vx_statistics/pair_data_point.cc#L1020-L1022

So that would be one place where if rej_vld is being incremented, check if the DEBUG exceeds some level and if so dump the row of data that's being rejected. I do think this would not be used very frequently, but the Python embedding case is a good example of where we were confident about this section of code (in pair_data_point.cc), but then came along with another way to serve data to this class (Python embedding). Future vehicles for serving data to MET that are yet to be defined would benefit from this added debugging.