ParameterDict

class lightworks.ParameterDict(**kwargs: Parameter[Any])

Stores a number of Parameters, using assigned keys to reference each Parameter object. This has custom get and set item which allows for the parameter object to be retrieved and the parameter value to be changed with the [] operator. For example ParameterDict[“a”] would return a Parameter object and ParameterDict[“a”] = 1 would set the value of the Parameter associated with the ‘a’ key to 1.

get_bounds() dict[str, tuple[Number | float, Number | float]]

Retrieves the bounds for all parameters stored in the ParameterDict and returns as a dictionary, where the keys match those used to store the parameters. If a particular parameter does not have one or both bounds set then the bounds will be set to +- inf.

has_bounds() bool

Checks if any of the parameters stored in the dictionary has a minimum and/or maximum bounds associated with it.

items() list[tuple[str, Any]]

Returns pairs of keys and parameter values in a list.

property params: list[str]

Returns a list of all parameter keys used in the dictionary.

remove(key: Any) None

Removes the parameter associated with the provided key from the ParameterDict.

Raises:

KeyError – Raised in cases where the key to remove does not exit in the ParameterDict.