Fix outliers() crash on bounded parameters with string dimension limits - #61
Fix outliers() crash on bounded parameters with string dimension limits#61arpitjain099 wants to merge 1 commit into
Conversation
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
|
Hi Arpit, Thank you for your PR on the After applying fixes the changes you have suggested no longer apply. Thank you for your help in uncovering this problem. I will close this PR at this time. |
Hi, thanks for maintaining pyPRMS.
Parameter.outliers()raises for any bounded parameter. The metadata loader keeps a dimension name as the maximum (for examplenlakeonlake_hru_id) when it can't cast the bound to the parameter datatype, sooutliers()ends up doing a numpy>between the int data and a string and hits a_UFuncNoLoopError. It affects the whole set of bounded params (lake_hru_id, hru_solsta, the cascade _down_id/_up_id parameters, and more).check_values()already skips the comparison when a bound is a string, so this just bringsoutliers()in line with that. Numeric bounds behave exactly as before; string bounds are skipped and no longer counted.Added a case to test_Parameter covering the bounded parameter.