SimPEG.utils.validate_string#

SimPEG.utils.validate_string(property_name, var, string_list=None, case_sensitive=False)[source]#

Validate a string property

Parameters:
property_namestr

The name of the property being set

varstr

The input variable

string_listlist or tuple of str, optional

Provide a list of acceptable strings, if an individual item is also a list, the extra parameters are interpreted as aliases for the first item, which is then returned.

case_sensitivebool, default: False

If True and string_list is not None, the string comparison is case-sensitive

Returns:
str

Returns the input argument var once validated