ertk.utils.filter_kwargs

ertk.utils.filter_kwargs(kwargs: Dict[str, Any], method: Callable) Dict[str, Any]

Removes incompatible keyword arguments. This ignores any **kwargs catchall in method signature, and only returns args specifically present as keywords in the method signature which are also not positional only.

Parameters:
params: dict

Keyword arguments to pass to method.

method: callable

The method for which to check valid parameters.

Returns:
dict

Filtered keyword arguments.