These are chat archives for symengine/symengine

6th
Oct 2015
Isuru Fernando
@isuruf
Oct 06 2015 07:18
@certik, should (x*y*2)**(1/2) be transformed automatically into (x*y)**(1/2)*2**(1/2) ?
Look at https://gitter.im/sympy/sympy?at=561260400b9059c80b7a5d0e
Converting the expression into SymEngine hits a lot of not canonical errors.
Björn Dahlgren
@bjodah
Oct 06 2015 13:51
I am trying to see if I can implement a symengine based version of lambdify in Cython (for use with scipy functions etc.). Are there any efforts already in this direction? I am trying to wrap my head around (no pun intended) symengine_wrapper.pyx, why is *thisptr not cdef'ed under cdef class Basic? (https://github.com/sympy/symengine/blob/master/symengine/python/symengine/lib/symengine_wrapper.pyx#L241)
Isuru Fernando
@isuruf
Oct 06 2015 13:53
They are declared in symenengine_wrapper.pxd which is the definition file. Definition is in another file so that other Cython modules can cimport Basic class
I don't think anybody else has started implementing lambdify
Let us know how it goes and if you need any clarification regarding the wrappers
Björn Dahlgren
@bjodah
Oct 06 2015 14:04
Ah, I see. Great, thanks! I'll try to see if I can make something work.
Björn Dahlgren
@bjodah
Oct 06 2015 14:19
Small comment/question: isn't it a bit confusing to have two things named Basic in Cython scopes: https://github.com/sympy/symengine/blob/master/symengine/python/symengine/lib/symengine_wrapper.pxd#L4, https://github.com/sympy/symengine/blob/master/symengine/python/symengine/lib/symengine.pxd#L82, I guess it's alright if I do from symegine_wrapper cimport Basic as PyBasic
Isuru Fernando
@isuruf
Oct 06 2015 14:28
When I was going through the code base for the first time it was kind of confusing.
Naming conventions are used such that it matches that of SymPy, so Basic, Add, Pow, Mul all have the same names as that of SymPy.
cimporting as PyBasic should work
Björn Dahlgren
@bjodah
Oct 06 2015 22:01
Thank you for the help, and your review. Another question: how do I build symengine for other versions of Python? I tried passing -DPYTHON_VERSION=3.4 etc. but no luck..