On Oct 31, 2007, at 12:22 PM, William Stein wrote:

> On 10/31/07, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
>>> I can think of lots of "solutions", although I don't know which of
>>> them might be worth the effort.
>>>
>>> 1) a global enable/disable
>>> 2) hook into __import__ to notice imports of numpy, and turn off the
>>> optimization globally if numpy is ever imported
>>> 3) patch numpy to add the incref/decref operations
>>> 4) patch numpy to turn off the optimization on entry to dangerous
>>> functions, and turn the optimization back on at exit
>>
>> I like 1-2. Options 3 and 4 seem like lots of (error-prone) work on
>> every numpy release. Numpy isn't imported by default, right?
>
> Correct, it isn't (or at least it shouldn't be, since importing it is
> slow).   However as soon as somebody uses matplotlib for
> anything,

So matplotlib depends on Numpy?

> or uses numerical matrices,

I thought we used GSL as a back end, but does it often fall back to  
Numpy then?

> it is very likely to get imported.

It doesn't look like arrays over PyObjects have their own module, or  
we could hook it to that (someone who knows numpy better could maybe  
verify?). We could also patch numpy to turn off inline operations  
whenever an array over generic objects is created. This at least  
should be pretty rare. Or we could consider options 3/4 (again, it  
would be nice if someone familiar with the numpy source could comment  
on this).

- Robert




--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to