bool_cast
- sherpa.utils.bool_cast(val: Any) bool[source] [edit on github]
Convert a scalar value to a boolean.
Changed in version 4.18.1: The input value must be a scalar. The support for converting an array of values has been removed.
Notes
The string is compared in a case-insensitive manner to the following: ‘true’, ‘on’, ‘yes’, ‘1’, ‘t’, and ‘y’ for
Trueand ‘false’, ‘off’, ‘no’, ‘0’, ‘f’, and ‘n’ forFalse.If there is no match to the above then the default conversion provided by the
boolroutine is used.