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. (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...)

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?

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.

Fredrik

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

Reply via email to