EMOD-Hub / EMOD

Source files for building the IDM EMOD disease transmission model.
MIT License
94 stars 41 forks source link

Improved IP error messaging #33

Open ckirkman-IDM opened 2 months ago

ckirkman-IDM commented 2 months ago

I got this error when accidentally configuring an IP with 3 values and 2 initial values:

GeneralConfigurationException: Exception in utils/BaseProperties.cpp at 343 in ReadProperty. Number of Values in Values (3) needs to be the same as number of values in Initial_Distribution (2).

It would be great for this message to be more informative to aid in detecting the source of the misconfiguration, especially if users ever get around to changing the "default" HIV IP states in future projects. Suggested message:

IP: Accessibility Number of values in Values (3) needs to be the same as number of values in Initial_Distribution (2): values: ['LOW', 'MEDIUM', HIGH'] initial_distribution: [0.8, 0.2]

Note I accidentally was setting IP:Risk initial values with initial distributions for IP:Accessibility :D