2016-06-22 10 views
0

Ich habe vor kurzem meine scipy Version von 0.13 auf die neueste aktualisiert.sph_harm von Scipy.special, 0.16+ gebrochen

Dies hat vorher funktioniert: es sagt

import numpy as np 
from scipy.special import sph_harm 
p,t=np.meshgrid(np.linspace(-np.pi/2.,np.pi/2.,300),np.linspace(0,2*np.pi,150)) 

s=sph_harm(n=4,m=3,theta=t,phi=p) 

Now 'viele Argumente zu' nur. Die Hilfe (sph_harm) zeigt auf die Definition der Klasse u_func und nicht auf die in den Dokumentationen angegebene Definition von sph_harm. Irgendwelche Ideen ?

Antwort

0

Beachten Sie, dass ufuncs der Regel nicht Schlüsselwort Argumente wie:

In [15]: import numpy as np 

In [16]: np.sin(x=np.pi) 
--------------------------------------------------------------------------- 
ValueError        Traceback (most recent call last) 
<ipython-input-16-42da70543d76> in <module>() 
----> 1 np.sin(x=np.pi) 

ValueError: invalid number of arguments 

Ebenso

In [25]: n, m = 4, 3 

In [26]: sph_harm(m, n, t, p) 
Out[26]: 
array([[ 0.00000000 +0.00000000e+00j, -0.01314889 +0.00000000e+00j, 
     -0.02628327 +0.00000000e+00j, ..., -0.02628327 +0.00000000e+00j, 
     -0.01314889 +0.00000000e+00j, 0.00000000 +0.00000000e+00j], 
     [ 0.00000000 +0.00000000e+00j, -0.01304381 -1.65899453e-03j, 
     -0.02607323 -3.31615792e-03j, ..., -0.02607323 -3.31615792e-03j, 
     -0.01304381 -1.65899453e-03j, 0.00000000 +0.00000000e+00j], 
     [ 0.00000000 +0.00000000e+00j, -0.01273026 -3.29147383e-03j, 
     -0.02544647 -6.57931466e-03j, ..., -0.02544647 -6.57931466e-03j, 
     -0.01273026 -3.29147383e-03j, 0.00000000 +0.00000000e+00j], 
     ..., 
     [ 0.00000000 +0.00000000e+00j, -0.01273026 +3.29147383e-03j, 
     -0.02544647 +6.57931466e-03j, ..., -0.02544647 +6.57931466e-03j, 
     -0.01273026 +3.29147383e-03j, 0.00000000 +0.00000000e+00j], 
     [ 0.00000000 +0.00000000e+00j, -0.01304381 +1.65899453e-03j, 
     -0.02607323 +3.31615792e-03j, ..., -0.02607323 +3.31615792e-03j, 
     -0.01304381 +1.65899453e-03j, 0.00000000 +0.00000000e+00j], 
     [ 0.00000000 +0.00000000e+00j, -0.01314889 +9.66132935e-18j, 
     -0.02628327 +1.93119949e-17j, ..., -0.02628327 +1.93119949e-17j, 
     -0.01314889 +9.66132935e-18j, 0.00000000 +0.00000000e+00j]])