MarkParametrize

class cosmo_utils.utils.file_utils.MarkParametrize(argname, argvalues)[source] [edit on github]

Bases: object

Parametrizes a set of values and changes the input variables of a function.

Initializes class object.

Parameters:

argname : str

Key of the element to change in main dictionary. It can only contain 1 word at a time.

argvalues : array-like

List of argvalues for each of the argnames. This list will be used to loop over the values and replace them into the main dictionary.

Notes

This function loops over the many different elements in argvalues. This function is meant to be used as a decorator for some function whose input a dictionary.

Methods Summary

__call__(func) This function gets executed when calling the function.

Methods Documentation

__call__(func)[source] [edit on github]

This function gets executed when calling the function. This functions changes the value of arguments in p_dict, and runs the function func with the given parameters.

Parameters:

func : function

Function that will be decorated.