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

User-Reported Defect: InitializePopulation fails with unclear message #288

Open
MeWu-IDM opened this issue Jul 28, 2023 · 2 comments
Open
Assignees
Labels
field defect User reported defect

Comments

@MeWu-IDM
Copy link
Collaborator

MeWu-IDM commented Jul 28, 2023

Describe the defect
This error is reported by external user @Nyerere who tried to use spreadsheet, in their "lookup" tab there is empty values for Female / Male column, I tried to help debugging

To reproduce
Steps to reproduce the behavior:

  1. Go to "Lookup Sheet", create a row with label but empty values for Male/Female
  2. Run pacehrh::InitializePopulation()

Expected behavior

  • If these rows are not able to be used, they should be removed with a warning to the user

Actual Behavior
User is getting an error that they do not understand how to proceed

Error in if (sex == "f" && (lt$Female[i] == FALSE)) { : 
  missing value where TRUE/FALSE needed
Called from: FUN(X[[i]], ...)
@MeWu-IDM MeWu-IDM added the field defect User reported defect label Jul 28, 2023
@MeWu-IDM
Copy link
Collaborator Author

Related: @BHagedorn-IDM spotted if column I ad J are empty, https://github.com/InstituteforDiseaseModeling/PACE-HRH/blob/main/pacehrh/R/pace_population_config.R#L177-L184 use the default min and max which may not be what user intended to do, we should at least give a warning or make these 2 values required.

@celiot-IDM celiot-IDM self-assigned this Jul 31, 2023
@celiot-IDM celiot-IDM added this to the V1.1 - PACE-HRH refresh milestone Jul 31, 2023
@celiot-IDM
Copy link
Collaborator

to do, we should at least give a warning or make these 2 values required.

I'm not sure this is the right answer either.

Sensible defaulting is a powerful tool for improving usability. In this case I would argue a few things:

  • In the absence of any other information, the most sensible default for the start of a range is the lowest possible value, and the most sensible default for the end of a range is the highest value.
  • Another basic principle is reducing the dependence on fixed hard-coded configuration values. The built-in age range is 0-100. Say the user has to explicitly enter 100 as the end point for any interval intended to represent "age X and above". Then say somebody decides to extend the built-in range to 110. Every hard-coded reference in configures ranges also has to change.
  • The argument that the user might not have intended this is countered by the argument that this might be exactly what they intended. "Age X and above" is a perfectly legitimate construct, so having a compact representation for it will (I expect) be seen by some users as a nice touch.
  • The idea that the system should generate a warning message any time it makes an implicit decision for the user is attractive, but the sheer volume of these informative messages could become a different problem. (Our standard model_inputs config file would generate 10 such warnings. Would we need a way to turn these warnings off if the system is system is in fact doing exactly the right thing for the user?)
  • Finally, we can discuss whether there's a better solution than a blank cell, perhaps a sentinel value like -1?

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

No branches or pull requests

2 participants