pyviability.helper module

helper.py provides small utilities that don’t really fit enywhere else but are needed in the package.

pyviability.helper.get_ordered_parameters(func, parameter_dict)[source]

Convert a dictionary of parameters for a function into an ordered tuple.

Parameters:
  • func (callable) – function whose argument order should be determined
  • parameter_dict (dict) –
    dictionary with
    keys : string representation of the positional arguments of func

    values : corresponding values that should be sorted by the order the keys appear as arguments for func

Returns:

tuple of the ordered parameters for func

Return type:

tuple

pyviability.helper.get_parameter_order(func)[source]

Get the order of positional arguments of a function.

Parameters:func (callable) – function whose argument order should be determined
Returns:list of string representations of func‘s arguments in the expected order
Return type:list