massbays-tech / MassWateR

R package for working with Massachusetts surface water quality data
https://massbays-tech.github.io/MassWateR
Creative Commons Zero v1.0 Universal
11 stars 3 forks source link

readMWRresults warning for incorrect characteristic names #16

Closed ben-wetherill closed 2 years ago

ben-wetherill commented 2 years ago

Maybe we should have a warning instead of an error for incorrect characteristic names in the results file. Since we want to provide the ability to pass data through R to the WQX file even if they are not using the QC functionality, we probably want to allow the possibility for them to send things through that don't match our parameter list. For example, if they are sending a parameter through, like gage height, they might have their own mapping set up in WQX and not care if it is evaluated in R. I think we just want to pass it through with a warning only. It would be ignored in the QA/QC and Analysis functions. Ignored in QA/QC if there is no DQO value for it, and ignored in Analysis if we don't have it in the parameter mapping table.

However, I do think that the every parameter in the DQO files should be in the parameter mapping table.

carrjill commented 2 years ago

Agreed - these should pass through with only a warning.

ben-wetherill commented 2 years ago

For result unit, can we make it an error if the characteristic name is valid and only a warning if the characteristic name is invalid (per above)?

fawda123 commented 2 years ago

@ben-wetherill the checks in your last comment will only work if I have a parameter name in the mapping file to compare to in the results file. So, I can produce an error only for valid characteristic names, but I have no way of know what's invalid (the list could be very long theoretically). In other words, there would be no way to produce the warning. But I agree, it will have to run the check only on the 'valid' parameter names in the mapping file.

ben-wetherill commented 2 years ago

Ah yes, you're right.