Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calc_waterstressindex checks wrong groundwaterclass object #129

Closed
BrentWHR opened this issue May 18, 2021 · 1 comment
Closed

calc_waterstressindex checks wrong groundwaterclass object #129

BrentWHR opened this issue May 18, 2021 · 1 comment

Comments

@BrentWHR
Copy link
Contributor

BrentWHR commented May 18, 2021

Groundwater class (B_GWL_CLASS) passed to calc_waterstressindex is updated to more generic ones within the function before checks are performed.
# update B_GWL_CLASS to more generic ones B_GWL_CLASS.wi <- gsub("b$","", B_GWL_CLASS)
A check is performed on B_GWL_CLASS instead of the more generic B_GWL_CLASS.wi :
checkmate::assert_subset(B_GWL_CLASS, choices = c('-',unique(waterstress.obic$gt)), empty.ok = FALSE)
While B_GWL_CLASS.wi is actually used in the function:
# Collect data in a table dt <- data.table( id = 1:arg.length, B_HELP_WENR = B_HELP_WENR, B_LU_BRP = B_LU_BRP, B_GWL_CLASS = B_GWL_CLASS.wi )

The result is that passing a valid gwl class such as "GtIIb" results in an error
Either the check on B_GWL_CLASS must be extended with more options or the check should be replaced with a check on B_GWL_CLASS.wi.

@gerardhros
Copy link
Contributor

is solved in branch gr_fix_management_score, merged into master in v1.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants