On Nov 16, 2009, at 4:47 PM, Strav wrote:

> If I run the code below:
>
> from scipy import integrate
>
> def fn(x):
>    return cos(3*x)^4
>
> res = integrate.quad(fn, 0, pi/6)
>
> -------------------------------------
>
> and then try:
>
> maxima(integrate(cos(3*x)^4))
>
> I get:
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call
> last)
>
> /home/strav/.sage/temp/strav_laptop/10825/_tmp_sage2207mWZ_sage_0.py
> in <module>()
>
> TypeError: 'module' object is not callable
>
> ---------------------------------------------------------------------------
>
> While calling maxima before import works perfectly.
>
> If any help is needed to reproduce this behavior, I'd be glad to help.

This is because when you type "from scipy import integrate" you are  
overwriting the integrate function. (There can only be one thing named  
integrate at a time in a given scope.)

sage: type(integrate)
<type 'function'>
sage: from scipy import integrate
sage: type(integrate)
<type 'module'>

You can get it back with reset.

sage: reset('integrate')
sage: type(integrate)
<type 'function'>
sage: maxima(integrate(cos(3*x)^4))
sin(12*x)/96+sin(6*x)/12+3*x/8

- Robert

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

Reply via email to