Add validation to case settings where appropriate
See original GitHub issueI have noticed a handful of case settings that have implied bounds on their ranges, but no check is ever done to confirm the user input a valid value. For instance, burnSteps
, nCycles
, and power
should all be non-negative but nothing stops the user from entering negative numbers.
In all of these instances, the code crashes somewhere where it is not necessarily clear what caused the crash. And in all instances, we could easily set a bound on the possible input values using the schema
attribute when each of the Setting
s are defined and using some of the built-ins of Voluptuous
(which we are already using). The schema for these cases would look something like voluptuous.Range(min=0)
. Very easy to add in.
I think it would be worthwhile to go through the case settings and add simple validators where they are not currently in place.
Does anybody have any objections to me doing this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Checklist of settings to add validation:
From globalSettings:
From databaseSettings:
From reportSettings:
See #595 for the PR.