bool_cast
- sherpa.utils.bool_cast(val)[source] [edit on github]
Convert a string to a boolean.
- Parameters
- Returns
flag – True or False if val is considered to be a true or false term. If val is a sequence then the return value is an ndarray of the same size.
- Return type
bool or ndarray
Notes
The string is compared in a case-insensitive manner to the following: ‘true’, ‘on’, ‘yes’, ‘1’, ‘t’, and ‘y’ for
True
and ‘false’, ‘off’, ‘no’, ‘0’, ‘f’, and ‘n’ forFalse
.If there is no match to the above then the default conversion provided by the
bool
routine is used.