finputcheck#

finputcheck(arguments, fieldlist, callingfunc='', mode='error', verbose='verbose', *, return_unrecognized=False)#

Validate EEGLAB-style key/value arguments against field rules.

Each field rule is (name, type, allowed_values, default). Supported types match EEGLAB’s finputcheck: boolean, integer, real, float, string, cell, struct, and function_handle. Validation failures are returned as strings, as in EEGLAB.

Parameters:
  • arguments (Mapping[str, Any] | Sequence[Any]) – Mapping or flat key/value sequence to validate.

  • fieldlist (Sequence[tuple[str, str | Sequence[str], Any, Any]]) – Validation rules in EEGLAB’s four-column order.

  • callingfunc (str) – Optional function name prefixed to error messages.

  • mode (str) – Use "ignore" to retain unrecognized arguments.

  • verbose (str) – Use "quiet" to suppress duplicate-key notices.

  • return_unrecognized (bool) – Also return a flat key/value list of arguments not declared by fieldlist. This is Python’s explicit equivalent of requesting EEGLAB’s second output.

Returns:

A validated dictionary or an error string. When return_unrecognized is true, also returns residual key/value pairs.

Return type:

dict[str, Any] | str | tuple[dict[str, Any] | str, list[Any]]