control.config._process_legacy_keyword

control.config._process_legacy_keyword(kwargs, oldkey, newkey, newval, warn_oldkey=True)[source]

Utility function for processing legacy keywords.

Deprecated since version 0.10.2: Replace with _process_param or _process_kwargs.

Use this function to handle a legacy keyword that has been renamed. This function pops the old keyword off of the kwargs dictionary and issues a warning. If both the old and new keyword are present, a ControlArgument exception is raised.

Parameters:
kwargsdict

Dictionary of keyword arguments (from function call).

oldkeystr

Old (legacy) parameter name.

newkeystr

Current name of the parameter.

newvalobject

Value of the current parameter (from the function signature).

warn_oldkeybool

If set to False, suppress generation of a warning about using a legacy keyword. This is useful if you have two versions of a keyword and you want to allow either to be used (see the cost and trajectory_cost keywords in flatsys.point_to_point for an example of this).

Returns:
valobject

Value of the (new) keyword.