sympy auto code generation module creator

24 views
Skip to first unread message

Guru Subramani

unread,
Jul 6, 2018, 6:14:39 PM7/6/18
to sympy
Hi Sympy!
I made an easy to use python module wrapper for auto-code generation similar to sympy's autowrap except the created module can be used later.

You can find it here:


The module allows adding multiple compiled expressions to a single cython module. This cython module can be imported at a later time and used like a normal module. The entire process is automated.

All the user needs to do is call a function called create_module() and pass a tuple list of the expression names, sympy expressions and argument lists. A module is created in a user specified directory. In a different python program, the user can import the created module and have access to the fast compiled version of the expressions.

It makes speeding up python code super easy and portable, the user doesn't have to involve them self with codegen etc.. It is similar to autowrap except the created module can be used at a later time.

Please look at the end of symcymod.py file for an example.

I think this is something a lot of people would like using but I don't know how to share the code. Maybe this could be integrated into the autowrap module. Please let me know what you think.


Thanks!
Guru

Aaron Meurer

unread,
Jul 7, 2018, 11:03:20 PM7/7/18
to sy...@googlegroups.com
Yes, this is something that I think autowrap should be able to do. If
I'm not mistaken the main thing that is missing is the ability to name
the module what you want. Or is there more that cannot be done from
autowrap itself?

You can already do it if you subclass the code wrapper class manually
and set the proper attributes, but it's not straightforward.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/0d2588d4-e06c-461f-be3c-ffad49c85000%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages