On Sun, May 31, 2009 at 11:48 PM, Fredrik Johansson
<fredrik.johans...@gmail.com> wrote:
>
> Hi all, I could use some guidance for mpmath/Sage integration.
>
> To put mpmath in Sage, I presume it should just be installed into
> site-packages as a regular Python library, so I should create an spkg
> that does the usual python setup.py install.

Yep.  Just copy what is done with some other spkg that packages some
standard Python program.

>  (Is there a policy of
> requiring the spkg to be a release version, or can I just put the
> trunk in there? The development version of mpmath is usually stable.
> Of course, arguably if a version is stable enough to put in Sage, it
> is also stable enough for standalone release...)

There is no such policy.  It is up to the package maintainer (which in
this case is you).

> Then there is the question of what to do with the Cython extension
> code, which contains partly of code to interface with Sage and partly
> of speed extensions for mpmath. In my own development repository, I've
> put this code in sage.libs.mpmath. Is this the right thing to do, or
> should I place it elsewhere in Sage or in mpmath itself?

sage.libs.mpmath makes a lot of sense to me.

> I think placing all Cython code in sage.* for now is easier because it
> depends on and interfaces with Sage libraries (such as its GMP/MPIR
> wrappers) and I can build it easily with sage -br. In the future, when
> things stabilize, I should be able to separate out the
> Sage-independent Cython code (which really only depends on GMP/MPIR
> and the Python API) and move it to mpmath itself.
>
> The namespace sage.libs.mpmath.all currently provides all mpmath
> functions as well as wrapper functions for internal Sage use, and
> importing from here instead of directly from mpmath will monkey patch
> some fast Cythonized functions into mpmath. This monkey patching is
> not so fragile as it possibly sounds, but it's not necessarily
> sustainable, so I might have to change it to make mpmath patch itself
> on startup by importing say
> sage.libs.mpmath._cythonized_backend_library, which shouldn't be a
> problem.

That sounds reasonable to me.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to