MCPcopy Create free account
hub / github.com/Morgansy/Genetic-Alpha / _Function

Class _Function

functions.py:20–49  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

18ind_label = pd.DataFrame()
19
20class _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
52def make_function(function, name, arity, wrap=True):

Callers 2

make_functionFunction · 0.85
functions.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected