(self, func_name, argtree)
Translate function names and the tree of arguments.

        If the function name is not in the dictionaries of dict_tuple_fun then the
        function is surrounded by a float((...).evalf()).

        The use of float is necessary as np.<function>(sympy.Float(..)) raises an
        error.
Translate function names and the tree of arguments.
Translate function names and the tree of arguments .
def translate_func(self, func_name, argtree):
        """Translate function names and the tree of arguments.

        If the function name is not in the dictionaries of dict_tuple_fun then the
        function is surrounded by a float((...).evalf()).

        The use of float is necessary as np.<function>(sympy.Float(..)) raises an
        error."""
        if func_name in self.dict_fun:
            new_name = self.dict_fun[func_name]
            argstr = self.tree2str_translate(argtree)
            return new_name + '(' + argstr
        else:
            template = '(%s(%s)).evalf(' if self.use_evalf else '%s(%s'
            if self.float_wrap_evalf:
                template = 'float(%s)' % template
            elif self.complex_wrap_evalf:
                template = 'complex(%s)' % template
            return template % (func_name, self.tree2str(argtree))
def translate_func ( self , func_name , argtree ) : if func_name in self . dict_fun : new_name = self . dict_fun [ func_name ] argstr = self . tree2str_translate ( argtree ) return new_name + '(' + argstr else : template = '(%s(%s)).evalf(' if self . use_evalf else '%s(%s' if self . float_wrap_evalf : template = 'float(%s)' % template elif self . complex_wrap_evalf : template = 'complex(%s)' % template return template % ( func_name , self . tree2str ( argtree ) )