mindscience.utils.check_dict_value

mindscience.utils.check_dict_value(param_dict, param_name, key_value=None, value_value=None)[source]

Check values for key and value of specified dict.

Parameters
  • param_dict (dict) – The dictionary to check.

  • param_name (str) – The name of the parameter.

  • key_value (Union[any, tuple, list, None], optional) – The allowed key values. Default: None.

  • value_value (Union[any, tuple, list, None], optional) – The allowed value values. Default: None.

Raises
  • TypeError – If the type of the param_dict is not dict.

  • ValueError – If the value of the key of param_dict is not in the allowed key values.

  • ValueError – If the value of the value of param_dict is not in the allowed value values.