control.config._process_kwargs

control.config._process_kwargs(kwargs, alias_mapping)[source]

Process aliases and legacy keywords.

Helper function to process function arguments by mapping aliases to their default keywords. The alias mapping is a dictionary that returns a tuple consisting of valid aliases and legacy aliases:

alias_mapping = {
     'argument_name_1': (['alias', ...], ['legacy', ...]),
     ...}

If an alias is present in the dictionary of keywords, it will be used to set the value of the argument. If a legacy keyword is used, a warning is issued.

Parameters
kwargsdict

Dictionary of variable keyword arguments.

alias_mappingdict

Dictionary providing aliases and legacy names.

Raises
TypeError

If multiple keyword aliased are used for the same parameter.

Warns
PendingDeprecationWarning

If legacy name is used to set the value for the variable.