← Back to team overview

aesthete-team team mailing list archive

Another mpmath diff

 

Hi all,

I just noticed that sec(𝛑) didn't work. Please find attached another patch (another hack, really) which seems to fix this for me.

Regards,
Chris.
=== modified file 'aesthete/glypher/Function.py'
--- aesthete/glypher/Function.py	2011-11-01 00:18:56 +0000
+++ aesthete/glypher/Function.py	2011-11-08 04:16:16 +0000
@@ -133,7 +133,13 @@
         args = self.get_sympy_args()
         try :
             if self.get_sympy_func() :
-                return self.get_sympy_func()(*args)
+                try:
+                    return self.get_sympy_func()(*args)
+                except:  # hack to get mpmath functions working
+                    new_args = []
+                    for arg in args:
+                        new_args.append(N(arg))
+                    return self.get_sympy_func()(*args)
             else :
                 debug_print('x')
                 f = Function(str(self.get_target('name').to_string()))


Follow ups