A representation of a mathematical relationship, a node in a program. This object is able to be called with NumPy vectorized arguments and return a resulting vector based on a mathematical relationship. Parameters ---------- function : callable A function with signature
| 18 | ind_label = pd.DataFrame() |
| 19 | |
| 20 | class _Function(object): |
| 21 | |
| 22 | """A representation of a mathematical relationship, a node in a program. |
| 23 | |
| 24 | This object is able to be called with NumPy vectorized arguments and return |
| 25 | a resulting vector based on a mathematical relationship. |
| 26 | |
| 27 | Parameters |
| 28 | ---------- |
| 29 | function : callable |
| 30 | A function with signature function(x1, *args) that returns a Numpy |
| 31 | array of the same shape as its arguments. |
| 32 | |
| 33 | name : str |
| 34 | The name for the function as it should be represented in the program |
| 35 | and its visualizations. |
| 36 | |
| 37 | arity : int |
| 38 | The number of arguments that the ``function`` takes. |
| 39 | |
| 40 | """ |
| 41 | |
| 42 | def __init__(self, function, name, arity, para): |
| 43 | self.function = function |
| 44 | self.name = name |
| 45 | self.arity = arity |
| 46 | self.para = para |
| 47 | |
| 48 | def __call__(self, *args): |
| 49 | return self.function(*args) |
| 50 | |
| 51 | |
| 52 | def make_function(function, name, arity, wrap=True): |
no outgoing calls
no test coverage detected