[Scipy-svn] r6800 - trunk/scipy/special/tests

scipy-svn@scip... scipy-svn@scip...
Sun Sep 12 16:30:28 CDT 2010


Author: warren.weckesser
Date: 2010-09-12 16:30:28 -0500 (Sun, 12 Sep 2010)
New Revision: 6800

Modified:
   trunk/scipy/special/tests/test_basic.py
   trunk/scipy/special/tests/test_data.py
   trunk/scipy/special/tests/test_lambertw.py
   trunk/scipy/special/tests/test_mpmath.py
   trunk/scipy/special/tests/test_orthogonal.py
   trunk/scipy/special/tests/test_orthogonal_eval.py
   trunk/scipy/special/tests/test_spfun_stats.py
   trunk/scipy/special/tests/testutils.py
Log:
TST: special: Don't use 'import *'.  Don't use plain 'assert'.  Rename tests that were different but had the same name.

Modified: trunk/scipy/special/tests/test_basic.py
===================================================================
--- trunk/scipy/special/tests/test_basic.py	2010-09-12 21:29:13 UTC (rev 6799)
+++ trunk/scipy/special/tests/test_basic.py	2010-09-12 21:30:28 UTC (rev 6800)
@@ -20,15 +20,18 @@
 #    test_sph_in
 #    test_sph_jn
 #    test_sph_kn
+
 import numpy as np
-from numpy import array
+from numpy import array, isnan, r_, arange, finfo, pi, sin, cos, tan, exp, log, zeros, \
+        sqrt, asarray, inf, nan_to_num, real, arctan, float_
 
-from numpy.testing import *
-from scipy.special import *
+from numpy.testing import assert_equal, assert_almost_equal, assert_array_equal, \
+        assert_array_almost_equal, assert_approx_equal, assert_, \
+        rand, dec, TestCase, run_module_suite
+from scipy import special
 import scipy.special._cephes as cephes
-import numpy as np
 
-from testutils import *
+from testutils import assert_tol_equal, with_special_errors
 
 class TestCephes(TestCase):
     def test_airy(self):
@@ -467,16 +470,16 @@
     def test_airy(self):
         #This tests the airy function to ensure 8 place accuracy in computation
 
-        x = airy(.99)
+        x = special.airy(.99)
         assert_array_almost_equal(x,array([0.13689066,-0.16050153,1.19815925,0.92046818]),8)
-        x = airy(.41)
+        x = special.airy(.41)
         assert_array_almost_equal(x,array([0.25238916,-.23480512,0.80686202,0.51053919]),8)
-        x = airy(-.36)
+        x = special.airy(-.36)
         assert_array_almost_equal(x,array([0.44508477,-0.23186773,0.44939534,0.48105354]),8)
 
     def test_airye(self):
-        a = airye(0.01)
-        b = airy(0.01)
+        a = special.airye(0.01)
+        b = special.airy(0.01)
         b1 = [None]*4
         for n in range(2):
             b1[n] = b[n]*exp(2.0/3.0*0.01*sqrt(0.01))
@@ -485,7 +488,7 @@
         assert_array_almost_equal(a,b1,6)
 
     def test_bi_zeros(self):
-        bi = bi_zeros(2)
+        bi = special.bi_zeros(2)
         bia = (array([-1.17371322, -3.2710930]),
         array([-2.29443968, -4.07315509]),
         array([-0.45494438,  0.39652284]),
@@ -493,7 +496,7 @@
         assert_array_almost_equal(bi,bia,4)
 
     def test_ai_zeros(self):
-        ai = ai_zeros(1)
+        ai = special.ai_zeros(1)
         assert_array_almost_equal(ai,(array([-2.33810741]),
                                      array([-1.01879297]),
                                      array([ 0.5357]),
@@ -501,10 +504,10 @@
 
 class TestAssocLaguerre(TestCase):
     def test_assoc_laguerre(self):
-        a1 = genlaguerre(11,1)
-        a2 = assoc_laguerre(.2,11,1)
+        a1 = special.genlaguerre(11,1)
+        a2 = special.assoc_laguerre(.2,11,1)
         assert_array_almost_equal(a2,a1(.2),8)
-        a2 = assoc_laguerre(1,11,1)
+        a2 = special.assoc_laguerre(1,11,1)
         assert_array_almost_equal(a2,a1(1),8)
 
 class TestBesselpoly(TestCase):
@@ -513,23 +516,23 @@
 
 class TestKelvin(TestCase):
     def test_bei(self):
-        mbei = bei(2)
+        mbei = special.bei(2)
         assert_almost_equal(mbei, 0.9722916273066613,5)#this may not be exact
 
     def test_beip(self):
-        mbeip = beip(2)
+        mbeip = special.beip(2)
         assert_almost_equal(mbeip,0.91701361338403631,5)#this may not be exact
 
     def test_ber(self):
-        mber = ber(2)
+        mber = special.ber(2)
         assert_almost_equal(mber,0.75173418271380821,5)#this may not be exact
 
     def test_berp(self):
-        mberp = berp(2)
+        mberp = special.berp(2)
         assert_almost_equal(mberp,-0.49306712470943909,5)#this may not be exact
 
     def test_bei_zeros(self):
-        bi = bi_zeros(5)
+        bi = special.bi_zeros(5)
         assert_array_almost_equal(bi[0],array([-1.173713222709127,
                                                -3.271093302836352,
                                                -4.830737841662016,
@@ -556,7 +559,7 @@
 
 
     def test_beip_zeros(self):
-        bip = beip_zeros(5)
+        bip = special.beip_zeros(5)
         assert_array_almost_equal(bip,array([  3.772673304934953,
                                                8.280987849760042,
                                                12.742147523633703,
@@ -564,7 +567,7 @@
                                                21.641143941167325]),4)
 
     def test_ber_zeros(self):
-        ber = ber_zeros(5)
+        ber = special.ber_zeros(5)
         assert_array_almost_equal(ber,array([2.84892,
                                              7.23883,
                                              11.67396,
@@ -572,7 +575,7 @@
                                              20.55463]),4)
 
     def test_berp_zeros(self):
-        brp = berp_zeros(5)
+        brp = special.berp_zeros(5)
         assert_array_almost_equal(brp,array([6.03871,
                                              10.51364,
                                              14.96844,
@@ -580,30 +583,30 @@
                                              23.86430]),4)
 
     def test_kelvin(self):
-        mkelv = kelvin(2)
-        assert_array_almost_equal(mkelv,(ber(2)+bei(2)*1j,
-                                         ker(2)+kei(2)*1j,
-                                         berp(2)+beip(2)*1j,
-                                         kerp(2)+keip(2)*1j),8)
+        mkelv = special.kelvin(2)
+        assert_array_almost_equal(mkelv,(special.ber(2) + special.bei(2)*1j,
+                                         special.ker(2) + special.kei(2)*1j,
+                                         special.berp(2) + special.beip(2)*1j,
+                                         special.kerp(2) + special.keip(2)*1j),8)
 
     def test_kei(self):
-        mkei = kei(2)
+        mkei = special.kei(2)
         assert_almost_equal(mkei,-0.20240006776470432,5)
 
     def test_keip(self):
-        mkeip = keip(2)
+        mkeip = special.keip(2)
         assert_almost_equal(mkeip,0.21980790991960536,5)
 
     def test_ker(self):
-        mker = ker(2)
+        mker = special.ker(2)
         assert_almost_equal(mker,-0.041664513991509472,5)
 
     def test_kerp(self):
-        mkerp = kerp(2)
+        mkerp = special.kerp(2)
         assert_almost_equal(mkerp,-0.10660096588105264,5)
 
     def test_kei_zeros(self):
-        kei = kei_zeros(5)
+        kei = special.kei_zeros(5)
         assert_array_almost_equal(kei,array([  3.91467,
                                               8.34422,
                                               12.78256,
@@ -611,7 +614,7 @@
                                               21.66464]),4)
 
     def test_keip_zeros(self):
-        keip = keip_zeros(5)
+        keip = special.keip_zeros(5)
         assert_array_almost_equal(keip,array([  4.93181,
                                                 9.40405,
                                                 13.85827,
@@ -622,7 +625,7 @@
 
     # numbers come from 9.9 of A&S pg. 381
     def test_kelvin_zeros(self):
-        tmp = kelvin_zeros(5)
+        tmp = special.kelvin_zeros(5)
         berz,beiz,kerz,keiz,berpz,beipz,kerpz,keipz = tmp
         assert_array_almost_equal(berz,array([ 2.84892,
                                                7.23883,
@@ -668,7 +671,7 @@
                                                 22.75379]),4)
 
     def test_ker_zeros(self):
-        ker = ker_zeros(5)
+        ker = special.ker_zeros(5)
         assert_array_almost_equal(ker,array([  1.71854,
                                                6.12728,
                                                10.56294,
@@ -676,7 +679,7 @@
                                                19.44381]),4)
 
     def test_kerp_zeros(self):
-        kerp = kerp_zeros(5)
+        kerp = special.kerp_zeros(5)
         assert_array_almost_equal(kerp,array([  2.66584,
                                                 7.17212,
                                                 11.63218,
@@ -685,7 +688,7 @@
 
 class TestBernoulli(TestCase):
     def test_bernoulli(self):
-        brn = bernoulli(5)
+        brn = special.bernoulli(5)
         assert_array_almost_equal(brn,array([1.0000,
                                              -0.5000,
                                              0.1667,
@@ -695,173 +698,174 @@
 
 class TestBeta(TestCase):
     def test_beta(self):
-        bet = beta(2,4)
-        betg = (gamma(2)*gamma(4))/gamma(6)
+        bet = special.beta(2,4)
+        betg = (special.gamma(2)*special.gamma(4))/special.gamma(6)
         assert_almost_equal(bet,betg,8)
 
     def test_betaln(self):
-        betln = betaln(2,4)
-        bet = log(abs(beta(2,4)))
+        betln = special.betaln(2,4)
+        bet = log(abs(special.beta(2,4)))
         assert_almost_equal(betln,bet,8)
 
     def test_betainc(self):
-        btinc = betainc(1,1,.2)
+        btinc = special.betainc(1,1,.2)
         assert_almost_equal(btinc,0.2,8)
 
     def test_betaincinv(self):
-        y = betaincinv(2,4,.5)
-        comp = betainc(2,4,y)
+        y = special.betaincinv(2,4,.5)
+        comp = special.betainc(2,4,y)
         assert_almost_equal(comp,.5,5)
 
 class TestTrigonometric(TestCase):
     def test_cbrt(self):
-        cb = cbrt(27)
+        cb = special.cbrt(27)
         cbrl = 27**(1.0/3.0)
         assert_approx_equal(cb,cbrl)
 
     def test_cbrtmore(self):
-        cb1 = cbrt(27.9)
+        cb1 = special.cbrt(27.9)
         cbrl1 = 27.9**(1.0/3.0)
         assert_almost_equal(cb1,cbrl1,8)
 
     def test_cosdg(self):
-        cdg = cosdg(90)
+        cdg = special.cosdg(90)
         cdgrl = cos(pi/2.0)
         assert_almost_equal(cdg,cdgrl,8)
 
     def test_cosdgmore(self):
-        cdgm = cosdg(30)
+        cdgm = special.cosdg(30)
         cdgmrl = cos(pi/6.0)
         assert_almost_equal(cdgm,cdgmrl,8)
 
     def test_cosm1(self):
-        cs = (cosm1(0),cosm1(.3),cosm1(pi/10))
+        cs = (special.cosm1(0),special.cosm1(.3),special.cosm1(pi/10))
         csrl = (cos(0)-1,cos(.3)-1,cos(pi/10)-1)
         assert_array_almost_equal(cs,csrl,8)
 
     def test_cotdg(self):
-        ct = cotdg(30)
+        ct = special.cotdg(30)
         ctrl = tan(pi/6.0)**(-1)
         assert_almost_equal(ct,ctrl,8)
 
     def test_cotdgmore(self):
-        ct1 = cotdg(45)
+        ct1 = special.cotdg(45)
         ctrl1 = tan(pi/4.0)**(-1)
         assert_almost_equal(ct1,ctrl1,8)
 
     def test_specialpoints(self):
-        assert_almost_equal(cotdg(45), 1.0, 14)
-        assert_almost_equal(cotdg(-45), -1.0, 14)
-        assert_almost_equal(cotdg(90), 0.0, 14)
-        assert_almost_equal(cotdg(-90), 0.0, 14)
-        assert_almost_equal(cotdg(135), -1.0, 14)
-        assert_almost_equal(cotdg(-135), 1.0, 14)
-        assert_almost_equal(cotdg(225), 1.0, 14)
-        assert_almost_equal(cotdg(-225), -1.0, 14)
-        assert_almost_equal(cotdg(270), 0.0, 14)
-        assert_almost_equal(cotdg(-270), 0.0, 14)
-        assert_almost_equal(cotdg(315), -1.0, 14)
-        assert_almost_equal(cotdg(-315), 1.0, 14)
-        assert_almost_equal(cotdg(765), 1.0, 14)
+        assert_almost_equal(special.cotdg(45), 1.0, 14)
+        assert_almost_equal(special.cotdg(-45), -1.0, 14)
+        assert_almost_equal(special.cotdg(90), 0.0, 14)
+        assert_almost_equal(special.cotdg(-90), 0.0, 14)
+        assert_almost_equal(special.cotdg(135), -1.0, 14)
+        assert_almost_equal(special.cotdg(-135), 1.0, 14)
+        assert_almost_equal(special.cotdg(225), 1.0, 14)
+        assert_almost_equal(special.cotdg(-225), -1.0, 14)
+        assert_almost_equal(special.cotdg(270), 0.0, 14)
+        assert_almost_equal(special.cotdg(-270), 0.0, 14)
+        assert_almost_equal(special.cotdg(315), -1.0, 14)
+        assert_almost_equal(special.cotdg(-315), 1.0, 14)
+        assert_almost_equal(special.cotdg(765), 1.0, 14)
 
     def test_sinc(self):
         c = arange(-2,2,.1)
-        y = sinc(c)
+        y = special.sinc(c)
         yre = sin(pi*c)/(pi*c)
         yre[20] = 1.0
         assert_array_almost_equal(y, yre, 4)
+
     def test_0(self):
         x = 0.0
-        assert_equal(sinc(x),1.0)
+        assert_equal(special.sinc(x),1.0)
 
     def test_sindg(self):
-        sn = sindg(90)
+        sn = special.sindg(90)
         assert_equal(sn,1.0)
 
     def test_sindgmore(self):
-        snm = sindg(30)
+        snm = special.sindg(30)
         snmrl = sin(pi/6.0)
         assert_almost_equal(snm,snmrl,8)
-        snm1 = sindg(45)
+        snm1 = special.sindg(45)
         snmrl1 = sin(pi/4.0)
         assert_almost_equal(snm1,snmrl1,8)
 
 class TestTandg(TestCase):
 
     def test_tandg(self):
-        tn = tandg(30)
+        tn = special.tandg(30)
         tnrl = tan(pi/6.0)
         assert_almost_equal(tn,tnrl,8)
 
     def test_tandgmore(self):
-        tnm = tandg(45)
+        tnm = special.tandg(45)
         tnmrl = tan(pi/4.0)
         assert_almost_equal(tnm,tnmrl,8)
-        tnm1 = tandg(60)
+        tnm1 = special.tandg(60)
         tnmrl1 = tan(pi/3.0)
         assert_almost_equal(tnm1,tnmrl1,8)
 
     def test_specialpoints(self):
-        assert_almost_equal(tandg(0), 0.0, 14)
-        assert_almost_equal(tandg(45), 1.0, 14)
-        assert_almost_equal(tandg(-45), -1.0, 14)
-        assert_almost_equal(tandg(135), -1.0, 14)
-        assert_almost_equal(tandg(-135), 1.0, 14)
-        assert_almost_equal(tandg(180), 0.0, 14)
-        assert_almost_equal(tandg(-180), 0.0, 14)
-        assert_almost_equal(tandg(225), 1.0, 14)
-        assert_almost_equal(tandg(-225), -1.0, 14)
-        assert_almost_equal(tandg(315), -1.0, 14)
-        assert_almost_equal(tandg(-315), 1.0, 14)
+        assert_almost_equal(special.tandg(0), 0.0, 14)
+        assert_almost_equal(special.tandg(45), 1.0, 14)
+        assert_almost_equal(special.tandg(-45), -1.0, 14)
+        assert_almost_equal(special.tandg(135), -1.0, 14)
+        assert_almost_equal(special.tandg(-135), 1.0, 14)
+        assert_almost_equal(special.tandg(180), 0.0, 14)
+        assert_almost_equal(special.tandg(-180), 0.0, 14)
+        assert_almost_equal(special.tandg(225), 1.0, 14)
+        assert_almost_equal(special.tandg(-225), -1.0, 14)
+        assert_almost_equal(special.tandg(315), -1.0, 14)
+        assert_almost_equal(special.tandg(-315), 1.0, 14)
 
 class TestEllip(TestCase):
     def test_ellipj_nan(self):
         """Regression test for #912."""
-        ellipj(0.5, np.nan)
+        special.ellipj(0.5, np.nan)
 
     def test_ellipj(self):
-        el = ellipj(0.2,0)
+        el = special.ellipj(0.2,0)
         rel = [sin(0.2),cos(0.2),1.0,0.20]
         assert_array_almost_equal(el,rel,13)
 
     def test_ellipk(self):
-        elk = ellipk(.2)
+        elk = special.ellipk(.2)
         assert_almost_equal(elk,1.659623598610528,11)
 
     def test_ellipkinc(self):
-        elkinc = ellipkinc(pi/2,.2)
-        elk = ellipk(0.2)
+        elkinc = special.ellipkinc(pi/2,.2)
+        elk = special.ellipk(0.2)
         assert_almost_equal(elkinc,elk,15)
         alpha = 20*pi/180
         phi = 45*pi/180
         m = sin(alpha)**2
-        elkinc = ellipkinc(phi,m)
+        elkinc = special.ellipkinc(phi,m)
         assert_almost_equal(elkinc,0.79398143,8)
         # From pg. 614 of A & S
 
     def test_ellipe(self):
-        ele = ellipe(.2)
+        ele = special.ellipe(.2)
         assert_almost_equal(ele,1.4890350580958529,8)
 
     def test_ellipeinc(self):
-        eleinc = ellipeinc(pi/2,.2)
-        ele = ellipe(0.2)
+        eleinc = special.ellipeinc(pi/2,.2)
+        ele = special.ellipe(0.2)
         assert_almost_equal(eleinc,ele,14)
         # pg 617 of A & S
         alpha, phi = 52*pi/180,35*pi/180
         m = sin(alpha)**2
-        eleinc = ellipeinc(phi,m)
+        eleinc = special.ellipeinc(phi,m)
         assert_almost_equal(eleinc, 0.58823065, 8)
 
 
 class TestErf(TestCase):
 
     def test_erf(self):
-        er = erf(.25)
+        er = special.erf(.25)
         assert_almost_equal(er,0.2763263902,8)
 
     def test_erf_zeros(self):
-        erz = erf_zeros(5)
+        erz = special.erf_zeros(5)
         erzr= array([1.45061616+1.88094300j,
                      2.24465928+2.61657514j,
                      2.83974105+3.17562810j,
@@ -870,30 +874,30 @@
         assert_array_almost_equal(erz,erzr,4)
 
     def test_erfcinv(self):
-        i = erfcinv(1)
+        i = special.erfcinv(1)
         assert_equal(i,0)
 
     def test_erfinv(self):
-        i = erfinv(0)
+        i = special.erfinv(0)
         assert_equal(i,0)
 
     def test_errprint(self):
-        a = errprint()
+        a = special.errprint()
         b = 1-a #a is the state 1-a inverts state
-        c = errprint(b) #returns last state 'a'
+        c = special.errprint(b) #returns last state 'a'
         assert_equal(a,c)
-        d = errprint(a) #returns to original state
+        d = special.errprint(a) #returns to original state
         assert_equal(d,b) #makes sure state was returned
         #assert_equal(d,1-a)
 
 class TestEuler(TestCase):
     def test_euler(self):
-        eu0 = euler(0)
-        eu1 = euler(1)
-        eu2 = euler(2)   # just checking segfaults
+        eu0 = special.euler(0)
+        eu1 = special.euler(1)
+        eu2 = special.euler(2)   # just checking segfaults
         assert_almost_equal(eu0[0],1,8)
         assert_almost_equal(eu2[2],-1,8)
-        eu24 = euler(24)
+        eu24 = special.euler(24)
         mathworld = [1,1,5,61,1385,50521,2702765,199360981,
                      19391512145l,2404879675441l,
                      370371188237525l,69348874393137901l,
@@ -910,44 +914,44 @@
 
 class TestExp(TestCase):
     def test_exp2(self):
-        ex = exp2(2)
+        ex = special.exp2(2)
         exrl = 2**2
         assert_equal(ex,exrl)
 
     def test_exp2more(self):
-        exm = exp2(2.5)
+        exm = special.exp2(2.5)
         exmrl = 2**(2.5)
         assert_almost_equal(exm,exmrl,8)
 
     def test_exp10(self):
-        ex = exp10(2)
+        ex = special.exp10(2)
         exrl = 10**2
         assert_approx_equal(ex,exrl)
 
     def test_exp10more(self):
-        exm = exp10(2.5)
+        exm = special.exp10(2.5)
         exmrl = 10**(2.5)
         assert_almost_equal(exm,exmrl,8)
 
     def test_expm1(self):
-        ex = (expm1(2),expm1(3),expm1(4))
+        ex = (special.expm1(2),special.expm1(3),special.expm1(4))
         exrl = (exp(2)-1,exp(3)-1,exp(4)-1)
         assert_array_almost_equal(ex,exrl,8)
 
     def test_expm1more(self):
-        ex1 = (expm1(2),expm1(2.1),expm1(2.2))
+        ex1 = (special.expm1(2),special.expm1(2.1),special.expm1(2.2))
         exrl1 = (exp(2)-1,exp(2.1)-1,exp(2.2)-1)
         assert_array_almost_equal(ex1,exrl1,8)
 
 class TestFresnel(TestCase):
     def test_fresnel(self):
-        frs = array(fresnel(.5))
+        frs = array(special.fresnel(.5))
         assert_array_almost_equal(frs,array([0.064732432859999287, 0.49234422587144644]),8)
 
     # values from pg 329  Table 7.11 of A & S
     #  slightly corrected in 4th decimal place
     def test_fresnel_zeros(self):
-        szo, czo = fresnel_zeros(5)
+        szo, czo = special.fresnel_zeros(5)
         assert_array_almost_equal(szo,
                                   array([ 2.0093+0.2885j,
                                           2.8335+0.2443j,
@@ -960,56 +964,56 @@
                                           3.3204+0.2240j,
                                           3.8757+0.2047j,
                                           4.3611+0.1907j]),3)
-        vals1 = fresnel(szo)[0]
-        vals2 = fresnel(czo)[1]
+        vals1 = special.fresnel(szo)[0]
+        vals2 = special.fresnel(czo)[1]
         assert_array_almost_equal(vals1,0,14)
         assert_array_almost_equal(vals2,0,14)
 
     def test_fresnelc_zeros(self):
-        szo, czo = fresnel_zeros(6)
-        frc = fresnelc_zeros(6)
+        szo, czo = special.fresnel_zeros(6)
+        frc = special.fresnelc_zeros(6)
         assert_array_almost_equal(frc,czo,12)
 
     def test_fresnels_zeros(self):
-        szo, czo = fresnel_zeros(5)
-        frs = fresnels_zeros(5)
+        szo, czo = special.fresnel_zeros(5)
+        frs = special.fresnels_zeros(5)
         assert_array_almost_equal(frs,szo,12)
 
 
 class TestGamma(TestCase):
     def test_gamma(self):
-        gam = gamma(5)
+        gam = special.gamma(5)
         assert_equal(gam,24.0)
 
     def test_gammaln(self):
-        gamln = gammaln(3)
-        lngam = log(gamma(3))
+        gamln = special.gammaln(3)
+        lngam = log(special.gamma(3))
         assert_almost_equal(gamln,lngam,8)
 
     def test_gammainc(self):
-        gama = gammainc(.5,.5)
+        gama = special.gammainc(.5,.5)
         assert_almost_equal(gama,.7,1)
 
     def test_gammaincc(self):
-        gicc = gammaincc(.5,.5)
-        greal = 1 - gammainc(.5,.5)
+        gicc = special.gammaincc(.5,.5)
+        greal = 1 - special.gammainc(.5,.5)
         assert_almost_equal(gicc,greal,8)
 
     def test_gammainccinv(self):
-        gccinv = gammainccinv(.5,.5)
-        gcinv = gammaincinv(.5,.5)
+        gccinv = special.gammainccinv(.5,.5)
+        gcinv = special.gammaincinv(.5,.5)
         assert_almost_equal(gccinv,gcinv,8)
 
     @with_special_errors
     def test_gammaincinv(self):
-        y = gammaincinv(.4,.4)
-        x = gammainc(.4,y)
+        y = special.gammaincinv(.4,.4)
+        x = special.gammainc(.4,y)
         assert_almost_equal(x,0.4,1)
-        y = gammainc(10, 0.05)
-        x = gammaincinv(10, 2.5715803516000736e-20)
+        y = special.gammainc(10, 0.05)
+        x = special.gammaincinv(10, 2.5715803516000736e-20)
         assert_almost_equal(0.05, x, decimal=10)
         assert_almost_equal(y, 2.5715803516000736e-20, decimal=10)
-        x = gammaincinv(50, 8.20754777388471303050299243573393e-18)
+        x = special.gammaincinv(50, 8.20754777388471303050299243573393e-18)
         assert_almost_equal(11.0, x, decimal=10)
 
     @with_special_errors
@@ -1021,64 +1025,65 @@
                np.nextafter(0.25, 0), 0.25 - 1e-12,
                np.nextafter(0.25, 1), 0.25 + 1e-12]
         for xp in pts:
-            y = gammaincinv(.4, xp)
-            x = gammainc(0.4, y)
+            y = special.gammaincinv(.4, xp)
+            x = special.gammainc(0.4, y)
             assert_tol_equal(x, xp, rtol=1e-12)
 
     def test_rgamma(self):
-        rgam = rgamma(8)
-        rlgam = 1/gamma(8)
+        rgam = special.rgamma(8)
+        rlgam = 1/special.gamma(8)
         assert_almost_equal(rgam,rlgam,8)
 
 class TestHankel(TestCase):
-    def test_negv(self):
-        assert_almost_equal(hankel1(-3,2), -hankel1(3,2), 14)
+    
+    def test_negv1(self):
+        assert_almost_equal(special.hankel1(-3,2), -special.hankel1(3,2), 14)
 
     def test_hankel1(self):
-        hank1 = hankel1(1,.1)
-        hankrl = (jv(1,.1)+yv(1,.1)*1j)
+        hank1 = special.hankel1(1,.1)
+        hankrl = (special.jv(1,.1) + special.yv(1,.1)*1j)
         assert_almost_equal(hank1,hankrl,8)
 
-    def test_negv(self):
-        assert_almost_equal(hankel1e(-3,2), -hankel1e(3,2), 14)
+    def test_negv1e(self):
+        assert_almost_equal(special.hankel1e(-3,2), -special.hankel1e(3,2), 14)
 
     def test_hankel1e(self):
-        hank1e = hankel1e(1,.1)
-        hankrle = hankel1(1,.1)*exp(-.1j)
+        hank1e = special.hankel1e(1,.1)
+        hankrle = special.hankel1(1,.1)*exp(-.1j)
         assert_almost_equal(hank1e,hankrle,8)
 
-    def test_negv(self):
-        assert_almost_equal(hankel2(-3,2), -hankel2(3,2), 14)
+    def test_negv2(self):
+        assert_almost_equal(special.hankel2(-3,2), -special.hankel2(3,2), 14)
 
     def test_hankel2(self):
-        hank2 = hankel2(1,.1)
-        hankrl2 = (jv(1,.1)-yv(1,.1)*1j)
+        hank2 = special.hankel2(1,.1)
+        hankrl2 = (special.jv(1,.1) - special.yv(1,.1)*1j)
         assert_almost_equal(hank2,hankrl2,8)
 
-    def test_negv(self):
-        assert_almost_equal(hankel2e(-3,2), -hankel2e(3,2), 14)
+    def test_neg2e(self):
+        assert_almost_equal(special.hankel2e(-3,2), -special.hankel2e(3,2), 14)
 
     def test_hankl2e(self):
-        hank2e = hankel2e(1,.1)
-        hankrl2e = hankel2e(1,.1)
+        hank2e = special.hankel2e(1,.1)
+        hankrl2e = special.hankel2e(1,.1)
         assert_almost_equal(hank2e,hankrl2e,8)
 
 class TestHyper(TestCase):
     def test_h1vp(self):
-        h1 = h1vp(1,.1)
-        h1real = (jvp(1,.1)+yvp(1,.1)*1j)
+        h1 = special.h1vp(1,.1)
+        h1real = (special.jvp(1,.1) + special.yvp(1,.1)*1j)
         assert_almost_equal(h1,h1real,8)
 
     def test_h2vp(self):
-        h2 = h2vp(1,.1)
-        h2real = (jvp(1,.1)-yvp(1,.1)*1j)
+        h2 = special.h2vp(1,.1)
+        h2real = (special.jvp(1,.1) - special.yvp(1,.1)*1j)
         assert_almost_equal(h2,h2real,8)
 
     def test_hyp0f1(self):
         pass
 
     def test_hyp1f1(self):
-        hyp1 = hyp1f1(.1,.1,.3)
+        hyp1 = special.hyp1f1(.1,.1,.3)
         assert_almost_equal(hyp1, 1.3498588075760032,7)
 
         # test contributed by Moritz Deger (2008-05-29)
@@ -1188,8 +1193,8 @@
                           [ -5.30592244e+00,  -2.42752190e+01,   1.29734035e+00,          1.31985534e+00]])
 
         for a,b,c,expected in ref_data:
-            result = hyp1f1(a,b,c)
-            assert(abs(expected - result)/expected < 1e-4)
+            result = special.hyp1f1(a,b,c)
+            assert_(abs(expected - result)/expected < 1e-4)
 
     def test_hyp1f2(self):
         pass
@@ -1205,13 +1210,13 @@
                   [3, 3.5, 1.5, 0.2**2,
                       0.5/0.2/(-5)*((1+0.2)**(-5)-(1-0.2)**(-5))],
                   [-3, 3, 0.5, sin(0.2)**2, cos(2*3*0.2)],
-                  [3, 4, 8, 1, gamma(8)*gamma(8-4-3)/gamma(8-3)/gamma(8-4)],
+                  [3, 4, 8, 1, special.gamma(8)*special.gamma(8-4-3)/special.gamma(8-3)/special.gamma(8-4)],
                   [3, 2, 3-2+1, -1, 1./2**3*sqrt(pi)*
-                      gamma(1+3-2)/gamma(1+0.5*3-2)/gamma(0.5+0.5*3)],
+                      special.gamma(1+3-2)/special.gamma(1+0.5*3-2)/special.gamma(0.5+0.5*3)],
                   [5, 2, 5-2+1, -1, 1./2**5*sqrt(pi)*
-                      gamma(1+5-2)/gamma(1+0.5*5-2)/gamma(0.5+0.5*5)],
-                  [4, 0.5+4, 1.5-2*4, -1./3, (8./9)**(-2*4)*gamma(4./3)*
-                      gamma(1.5-2*4)/gamma(3./2)/gamma(4./3-2*4)],
+                      special.gamma(1+5-2)/special.gamma(1+0.5*5-2)/special.gamma(0.5+0.5*5)],
+                  [4, 0.5+4, 1.5-2*4, -1./3, (8./9)**(-2*4)*special.gamma(4./3)*
+                      special.gamma(1.5-2*4)/special.gamma(3./2)/special.gamma(4./3-2*4)],
                   # and some others
                   # ticket #424
                   [1.5, -0.5, 1.0, -10.0, 4.1300097765277476484],
@@ -1225,53 +1230,53 @@
                   (10, -900, -10.5, 0.99, 3.54279200040355710199058559155e-18),
                   ]
         for i, (a, b, c, x, v) in enumerate(values):
-            cv = hyp2f1(a, b, c, x)
+            cv = special.hyp2f1(a, b, c, x)
             assert_almost_equal(cv, v, 8, err_msg='test #%d' % i)
 
     def test_hyp3f0(self):
         pass
 
     def test_hyperu(self):
-        val1 = hyperu(1,0.1,100)
+        val1 = special.hyperu(1,0.1,100)
         assert_almost_equal(val1,0.0098153,7)
         a,b = [0.3,0.6,1.2,-2.7],[1.5,3.2,-0.4,-3.2]
         a,b = asarray(a), asarray(b)
         z = 0.5
-        hypu = hyperu(a,b,z)
-        hprl = (pi/sin(pi*b))*(hyp1f1(a,b,z)/ \
-                               (gamma(1+a-b)*gamma(b))- \
-                               z**(1-b)*hyp1f1(1+a-b,2-b,z) \
-                               /(gamma(a)*gamma(2-b)))
+        hypu = special.hyperu(a,b,z)
+        hprl = (pi/sin(pi*b))*(special.hyp1f1(a,b,z)/ \
+                               (special.gamma(1+a-b)*special.gamma(b))- \
+                               z**(1-b)*special.hyp1f1(1+a-b,2-b,z) \
+                               /(special.gamma(a)*special.gamma(2-b)))
         assert_array_almost_equal(hypu,hprl,12)
 
 class TestBessel(TestCase):
     def test_itj0y0(self):
-        it0 = array(itj0y0(.2))
+        it0 = array(special.itj0y0(.2))
         assert_array_almost_equal(it0,array([0.19933433254006822, -0.34570883800412566]),8)
 
     def test_it2j0y0(self):
-        it2 = array(it2j0y0(.2))
+        it2 = array(special.it2j0y0(.2))
         assert_array_almost_equal(it2,array([0.0049937546274601858, -0.43423067011231614]),8)
 
-    def test_negv(self):
-        assert_equal(iv(3,2), iv(-3,2))
+    def test_negv_iv(self):
+        assert_equal(special.iv(3,2), special.iv(-3,2))
 
     def test_j0(self):
-        oz = j0(.1)
-        ozr = jn(0,.1)
+        oz = special.j0(.1)
+        ozr = special.jn(0,.1)
         assert_almost_equal(oz,ozr,8)
 
     def test_j1(self):
-        o1 = j1(.1)
-        o1r = jn(1,.1)
+        o1 = special.j1(.1)
+        o1r = special.jn(1,.1)
         assert_almost_equal(o1,o1r,8)
 
     def test_jn(self):
-        jnnr = jn(1,.2)
+        jnnr = special.jn(1,.2)
         assert_almost_equal(jnnr,0.099500832639235995,8)
 
-    def test_negv(self):
-        assert_almost_equal(jv(-3,2), -jv(3,2), 14)
+    def test_negv_jv(self):
+        assert_almost_equal(special.jv(-3,2), -special.jv(3,2), 14)
 
     def test_jv(self):
         values = [[0, 0.1, 0.99750156206604002],
@@ -1281,23 +1286,23 @@
                   [2./3, 4.0, -0.2325440850267039],
                  ]
         for i, (v, x, y) in enumerate(values):
-            yc = jv(v, x)
+            yc = special.jv(v, x)
             assert_almost_equal(yc, y, 8, err_msg='test #%d' % i)
 
-    def test_negv(self):
-        assert_almost_equal(jve(-3,2), -jve(3,2), 14)
+    def test_negv_jve(self):
+        assert_almost_equal(special.jve(-3,2), -special.jve(3,2), 14)
 
     def test_jve(self):
-        jvexp = jve(1,.2)
+        jvexp = special.jve(1,.2)
         assert_almost_equal(jvexp,0.099500832639235995,8)
-        jvexp1 = jve(1,.2+1j)
+        jvexp1 = special.jve(1,.2+1j)
         z = .2+1j
-        jvexpr = jv(1,z)*exp(-abs(z.imag))
+        jvexpr = special.jv(1,z)*exp(-abs(z.imag))
         assert_almost_equal(jvexp1,jvexpr,8)
 
     def test_jn_zeros(self):
-        jn0 = jn_zeros(0,5)
-        jn1 = jn_zeros(1,5)
+        jn0 = special.jn_zeros(0,5)
+        jn1 = special.jn_zeros(1,5)
         assert_array_almost_equal(jn0,array([ 2.4048255577,
                                               5.5200781103,
                                               8.6537279129,
@@ -1309,14 +1314,14 @@
                                               13.32369,
                                               16.47063]),4)
 
-        jn102 = jn_zeros(102,5)
+        jn102 = special.jn_zeros(102,5)
         assert_tol_equal(jn102, array([110.89174935992040343,
                                        117.83464175788308398,
                                        123.70194191713507279,
                                        129.02417238949092824,
                                        134.00114761868422559]), rtol=1e-13)
         
-        jn301 = jn_zeros(301,5)
+        jn301 = special.jn_zeros(301,5)
         assert_tol_equal(jn301, array([313.59097866698830153,
                                        323.21549776096288280,
                                        331.22338738656748796,
@@ -1324,17 +1329,17 @@
                                        345.03284233056064157]), rtol=1e-13)
 
     def test_jn_zeros_slow(self):
-        jn0 = jn_zeros(0, 300)
+        jn0 = special.jn_zeros(0, 300)
         assert_tol_equal(jn0[260-1], 816.02884495068867280, rtol=1e-13)
         assert_tol_equal(jn0[280-1], 878.86068707124422606, rtol=1e-13)
         assert_tol_equal(jn0[300-1], 941.69253065317954064, rtol=1e-13)
         
-        jn10 = jn_zeros(10, 300)
+        jn10 = special.jn_zeros(10, 300)
         assert_tol_equal(jn10[260-1], 831.67668514305631151, rtol=1e-13)
         assert_tol_equal(jn10[280-1], 894.51275095371316931, rtol=1e-13)
         assert_tol_equal(jn10[300-1], 957.34826370866539775, rtol=1e-13)
 
-        jn3010 = jn_zeros(3010,5)
+        jn3010 = special.jn_zeros(3010,5)
         assert_tol_equal(jn3010, array([3036.86590780927,
                                         3057.06598526482,
                                         3073.66360690272,
@@ -1349,17 +1354,17 @@
         #to the inputs
 
     def test_jnp_zeros(self):
-        jnp = jnp_zeros(1,5)
+        jnp = special.jnp_zeros(1,5)
         assert_array_almost_equal(jnp, array([  1.84118,
                                                 5.33144,
                                                 8.53632,
                                                 11.70600,
                                                 14.86359]),4)
-        jnp = jnp_zeros(443,5)
-        assert_tol_equal(jvp(443, jnp), 0, atol=1e-15)
+        jnp = special.jnp_zeros(443,5)
+        assert_tol_equal(special.jvp(443, jnp), 0, atol=1e-15)
 
     def test_jnyn_zeros(self):
-        jnz = jnyn_zeros(1,5)
+        jnz = special.jnyn_zeros(1,5)
         assert_array_almost_equal(jnz,(array([  3.83171,
                                                 7.01559,
                                                 10.17347,
@@ -1382,37 +1387,37 @@
                                                 16.44006])),5)
 
     def test_jvp(self):
-        jvprim = jvp(2,2)
-        jv0 = (jv(1,2)-jv(3,2))/2
+        jvprim = special.jvp(2,2)
+        jv0 = (special.jv(1,2)-special.jv(3,2))/2
         assert_almost_equal(jvprim,jv0,10)
 
     def test_k0(self):
-        ozk = k0(.1)
-        ozkr = kv(0,.1)
+        ozk = special.k0(.1)
+        ozkr = special.kv(0,.1)
         assert_almost_equal(ozk,ozkr,8)
 
     def test_k0e(self):
-        ozke = k0e(.1)
-        ozker = kve(0,.1)
+        ozke = special.k0e(.1)
+        ozker = special.kve(0,.1)
         assert_almost_equal(ozke,ozker,8)
 
     def test_k1(self):
-        o1k = k1(.1)
-        o1kr = kv(1,.1)
+        o1k = special.k1(.1)
+        o1kr = special.kv(1,.1)
         assert_almost_equal(o1k,o1kr,8)
 
     def test_k1e(self):
-        o1ke = k1e(.1)
-        o1ker = kve(1,.1)
+        o1ke = special.k1e(.1)
+        o1ker = special.kve(1,.1)
         assert_almost_equal(o1ke,o1ker,8)
 
     def test_jacobi(self):
         a = 5*rand() - 1
         b = 5*rand() - 1
-        P0 = jacobi(0,a,b)
-        P1 = jacobi(1,a,b)
-        P2 = jacobi(2,a,b)
-        P3 = jacobi(3,a,b)
+        P0 = special.jacobi(0,a,b)
+        P1 = special.jacobi(1,a,b)
+        P2 = special.jacobi(2,a,b)
+        P3 = special.jacobi(3,a,b)
 
         assert_array_almost_equal(P0.c,[1],13)
         assert_array_almost_equal(P1.c,array([a+b+2,a-b])/2.0,13)
@@ -1425,127 +1430,129 @@
         assert_array_almost_equal(P3.c,array(p3c)/48.0,13)
 
     def test_kn(self):
-        kn1 = kn(0,.2)
+        kn1 = special.kn(0,.2)
         assert_almost_equal(kn1,1.7527038555281462,8)
 
-    def test_negv(self):
-        assert_equal(kv(3.0, 2.2), kv(-3.0, 2.2))
+    def test_negv_kv(self):
+        assert_equal(special.kv(3.0, 2.2), special.kv(-3.0, 2.2))
 
     def test_kv0(self):
-        kv0 = kv(0,.2)
+        kv0 = special.kv(0,.2)
         assert_almost_equal(kv0, 1.7527038555281462, 10)
+
     def test_kv1(self):
-        kv1 = kv(1,0.2)
+        kv1 = special.kv(1,0.2)
         assert_almost_equal(kv1, 4.775972543220472, 10)
+
     def test_kv2(self):
-        kv2 = kv(2,0.2)
+        kv2 = special.kv(2,0.2)
         assert_almost_equal(kv2, 49.51242928773287, 10)
 
 
-    def test_negv(self):
-        assert_equal(kve(3.0, 2.2), kve(-3.0, 2.2))
+    def test_negv_kve(self):
+        assert_equal(special.kve(3.0, 2.2), special.kve(-3.0, 2.2))
 
     def test_kve(self):
-        kve1 = kve(0,.2)
-        kv1 = kv(0,.2)*exp(.2)
+        kve1 = special.kve(0,.2)
+        kv1 = special.kv(0,.2)*exp(.2)
         assert_almost_equal(kve1,kv1,8)
         z = .2+1j
-        kve2 = kve(0,z)
-        kv2 = kv(0,z)*exp(z)
+        kve2 = special.kve(0,z)
+        kv2 = special.kv(0,z)*exp(z)
         assert_almost_equal(kve2,kv2,8)
 
     def test_kvp_v0n1(self):
         z = 2.2
-        assert_almost_equal(-kv(1,z), kvp(0,z, n=1), 10)
+        assert_almost_equal(-special.kv(1,z), special.kvp(0,z, n=1), 10)
 
     def test_kvp_n1(self):
         v = 3.
         z = 2.2
-        xc = -kv(v+1,z) + v/z*kv(v,z)
-        x = kvp(v,z, n=1)
+        xc = -special.kv(v+1,z) + v/z*special.kv(v,z)
+        x = special.kvp(v,z, n=1)
         assert_almost_equal(xc, x, 10)   #this function (kvp) is broken
 
     def test_kvp_n2(self):
         v = 3.
         z = 2.2
-        xc = (z**2+v**2-v)/z**2 * kv(v,z) + kv(v+1,z)/z
-        x = kvp(v, z, n=2)
+        xc = (z**2+v**2-v)/z**2 * special.kv(v,z) + special.kv(v+1,z)/z
+        x = special.kvp(v, z, n=2)
         assert_almost_equal(xc, x, 10)
 
     def test_y0(self):
-        oz = y0(.1)
-        ozr = yn(0,.1)
+        oz = special.y0(.1)
+        ozr = special.yn(0,.1)
         assert_almost_equal(oz,ozr,8)
 
     def test_y1(self):
-        o1 = y1(.1)
-        o1r = yn(1,.1)
+        o1 = special.y1(.1)
+        o1r = special.yn(1,.1)
         assert_almost_equal(o1,o1r,8)
 
     def test_y0_zeros(self):
-        yo,ypo = y0_zeros(2)
-        zo,zpo = y0_zeros(2,complex=1)
+        yo,ypo = special.y0_zeros(2)
+        zo,zpo = special.y0_zeros(2,complex=1)
         all = r_[yo,zo]
         allval = r_[ypo,zpo]
-        assert_array_almost_equal(abs(yv(0.0,all)),0.0,11)
-        assert_array_almost_equal(abs(yv(1,all)-allval),0.0,11)
+        assert_array_almost_equal(abs(special.yv(0.0,all)),0.0,11)
+        assert_array_almost_equal(abs(special.yv(1,all)-allval),0.0,11)
 
 
     def test_y1_zeros(self):
-        y1 = y1_zeros(1)
+        y1 = special.y1_zeros(1)
         assert_array_almost_equal(y1,(array([2.19714]),array([0.52079])),5)
 
     def test_y1p_zeros(self):
-        y1p = y1p_zeros(1,complex=1)
+        y1p = special.y1p_zeros(1,complex=1)
         assert_array_almost_equal(y1p,(array([ 0.5768+0.904j]), array([-0.7635+0.5892j])),3)
 
     def test_yn_zeros(self):
-        an = yn_zeros(4,2)
+        an = special.yn_zeros(4,2)
         assert_array_almost_equal(an,array([ 5.64515,  9.36162]),5)
-        an = yn_zeros(443,5)
+        an = special.yn_zeros(443,5)
         assert_tol_equal(an, [450.13573091578090314, 463.05692376675001542, 
                               472.80651546418663566, 481.27353184725625838,
                               488.98055964441374646], rtol=1e-15)
 
     def test_ynp_zeros(self):
-        ao = ynp_zeros(0,2)
+        ao = special.ynp_zeros(0,2)
         assert_array_almost_equal(ao,array([ 2.19714133, 5.42968104]),6)
-        ao = ynp_zeros(43,5)
-        assert_tol_equal(yvp(43, ao), 0, atol=1e-15)
-        ao = ynp_zeros(443,5)
-        assert_tol_equal(yvp(443, ao), 0, atol=1e-9)
+        ao = special.ynp_zeros(43,5)
+        assert_tol_equal(special.yvp(43, ao), 0, atol=1e-15)
+        ao = special.ynp_zeros(443,5)
+        assert_tol_equal(special.yvp(443, ao), 0, atol=1e-9)
 
     @dec.knownfailureif(True,
                         "cephes/yv is not eps accurate for large orders on "
                         "all platforms, and has nan/inf issues")
     def test_ynp_zeros_large_order(self):
-        ao = ynp_zeros(443,5)
-        assert_tol_equal(yvp(443, ao), 0, atol=1e-15)
+        ao = special.ynp_zeros(443,5)
+        assert_tol_equal(special.yvp(443, ao), 0, atol=1e-15)
 
     def test_yn(self):
-        yn2n = yn(1,.2)
+        yn2n = special.yn(1,.2)
         assert_almost_equal(yn2n,-3.3238249881118471,8)
 
-    def test_negv(self):
-        assert_almost_equal(yv(-3,2), -yv(3,2), 14)
+    def test_negv_yv(self):
+        assert_almost_equal(special.yv(-3,2), -special.yv(3,2), 14)
 
     def test_yv(self):
-        yv2 = yv(1,.2)
+        yv2 = special.yv(1,.2)
         assert_almost_equal(yv2,-3.3238249881118471,8)
 
-    def test_negv(self):
-        assert_almost_equal(yve(-3,2), -yve(3,2), 14)
+    def test_negv_yve(self):
+        assert_almost_equal(special.yve(-3,2), -special.yve(3,2), 14)
 
     def test_yve(self):
-        yve2 = yve(1,.2)
+        yve2 = special.yve(1,.2)
         assert_almost_equal(yve2,-3.3238249881118471,8)
-        yve2r = yv(1,.2+1j)*exp(-1)
-        yve22 = yve(1,.2+1j)
+        yve2r = special.yv(1,.2+1j)*exp(-1)
+        yve22 = special.yve(1,.2+1j)
         assert_almost_equal(yve22,yve2r,8)
 
     def test_yvp(self):
-        yvpr = (yv(1,.2) - yv(3,.2))/2.0
-        yvp1 = yvp(2,.2)
+        yvpr = (special.yv(1,.2) - special.yv(3,.2))/2.0
+        yvp1 = special.yvp(2,.2)
         assert_array_almost_equal(yvp1,yvpr,10)
 
 
@@ -1569,9 +1576,9 @@
                 continue
             c1, c2, c3 = f1(v, z), f1(v,z+0j), f2(int(v), z)
             if np.isinf(c1):
-                assert np.abs(c2) >= 1e300, (v, z)
+                assert_(np.abs(c2) >= 1e300, (v, z))
             elif np.isnan(c1):
-                assert c2.imag != 0, (v, z)
+                assert_(c2.imag != 0, (v, z))
             else:
                 assert_tol_equal(c1, c2, err_msg=(v, z), rtol=rtol, atol=atol)
                 if v == int(v):
@@ -1579,20 +1586,20 @@
                                      rtol=rtol, atol=atol)
 
     def test_jv_cephes_vs_amos(self):
-        self.check_cephes_vs_amos(jv, jn, rtol=1e-10, atol=1e-305)
+        self.check_cephes_vs_amos(special.jv, special.jn, rtol=1e-10, atol=1e-305)
 
     @dec.knownfailureif(True,
                         "cephes/yv is not eps accurate for large orders on "
                         "all platforms, and has nan/inf issues")
     def test_yv_cephes_vs_amos(self):
-        self.check_cephes_vs_amos(yv, yn, rtol=1e-11, atol=1e-305)
+        self.check_cephes_vs_amos(special.yv, special.yn, rtol=1e-11, atol=1e-305)
 
     def test_yv_cephes_vs_amos_only_small_orders(self):
         skipper = lambda v, z: (abs(v) > 50)
-        self.check_cephes_vs_amos(yv, yn, rtol=1e-11, atol=1e-305, skip=skipper)
+        self.check_cephes_vs_amos(special.yv, special.yn, rtol=1e-11, atol=1e-305, skip=skipper)
 
     def test_iv_cephes_vs_amos(self):
-        self.check_cephes_vs_amos(iv, iv, rtol=5e-9, atol=1e-305)
+        self.check_cephes_vs_amos(special.iv, special.iv, rtol=5e-9, atol=1e-305)
 
     @dec.slow
     def test_iv_cephes_vs_amos_mass_test(self):
@@ -1604,8 +1611,8 @@
         imsk = (np.random.randint(8, size=N) == 0)
         v[imsk] = v.astype(int)
 
-        c1 = iv(v, x)
-        c2 = iv(v, x+0j)
+        c1 = special.iv(v, x)
+        c2 = special.iv(v, x+0j)
 
         # deal with differences in the inf cutoffs
         c1[abs(c1) > 1e300] = np.inf
@@ -1618,89 +1625,89 @@
 
         # Most error apparently comes from AMOS and not our implementation;
         # there are some problems near integer orders there
-        assert dc[k] < 1e-9, (v[k], x[k], iv(v[k], x[k]), iv(v[k], x[k]+0j))
+        assert_(dc[k] < 1e-9, (v[k], x[k], special.iv(v[k], x[k]), special.iv(v[k], x[k]+0j)))
 
     def test_kv_cephes_vs_amos(self):
         #self.check_cephes_vs_amos(kv, kn, rtol=1e-9, atol=1e-305)
-        self.check_cephes_vs_amos(kv, kv, rtol=1e-9, atol=1e-305)
+        self.check_cephes_vs_amos(special.kv, special.kv, rtol=1e-9, atol=1e-305)
 
     def test_ticket_623(self):
-        assert_tol_equal(jv(3, 4), 0.43017147387562193)
-        assert_tol_equal(jv(301, 1300), 0.0183487151115275)
-        assert_tol_equal(jv(301, 1296.0682), -0.0224174325312048)
+        assert_tol_equal(special.jv(3, 4), 0.43017147387562193)
+        assert_tol_equal(special.jv(301, 1300), 0.0183487151115275)
+        assert_tol_equal(special.jv(301, 1296.0682), -0.0224174325312048)
 
     def test_ticket_853(self):
         """Negative-order Bessels"""
         # cephes
-        assert_tol_equal(jv(-1,   1   ), -0.4400505857449335)
-        assert_tol_equal(jv(-2,   1   ), 0.1149034849319005)
-        assert_tol_equal(yv(-1,   1   ), 0.7812128213002887)
-        assert_tol_equal(yv(-2,   1   ), -1.650682606816255)
-        assert_tol_equal(iv(-1,   1   ), 0.5651591039924851)
-        assert_tol_equal(iv(-2,   1   ), 0.1357476697670383)
-        assert_tol_equal(kv(-1,   1   ), 0.6019072301972347)
-        assert_tol_equal(kv(-2,   1   ), 1.624838898635178)
-        assert_tol_equal(jv(-0.5, 1   ), 0.43109886801837607952)
-        assert_tol_equal(yv(-0.5, 1   ), 0.6713967071418031)
-        assert_tol_equal(iv(-0.5, 1   ), 1.231200214592967)
-        assert_tol_equal(kv(-0.5, 1   ), 0.4610685044478945)
+        assert_tol_equal(special.jv(-1,   1   ), -0.4400505857449335)
+        assert_tol_equal(special.jv(-2,   1   ), 0.1149034849319005)
+        assert_tol_equal(special.yv(-1,   1   ), 0.7812128213002887)
+        assert_tol_equal(special.yv(-2,   1   ), -1.650682606816255)
+        assert_tol_equal(special.iv(-1,   1   ), 0.5651591039924851)
+        assert_tol_equal(special.iv(-2,   1   ), 0.1357476697670383)
+        assert_tol_equal(special.kv(-1,   1   ), 0.6019072301972347)
+        assert_tol_equal(special.kv(-2,   1   ), 1.624838898635178)
+        assert_tol_equal(special.jv(-0.5, 1   ), 0.43109886801837607952)
+        assert_tol_equal(special.yv(-0.5, 1   ), 0.6713967071418031)
+        assert_tol_equal(special.iv(-0.5, 1   ), 1.231200214592967)
+        assert_tol_equal(special.kv(-0.5, 1   ), 0.4610685044478945)
         # amos
-        assert_tol_equal(jv(-1,   1+0j), -0.4400505857449335)
-        assert_tol_equal(jv(-2,   1+0j), 0.1149034849319005)
-        assert_tol_equal(yv(-1,   1+0j), 0.7812128213002887)
-        assert_tol_equal(yv(-2,   1+0j), -1.650682606816255)
+        assert_tol_equal(special.jv(-1,   1+0j), -0.4400505857449335)
+        assert_tol_equal(special.jv(-2,   1+0j), 0.1149034849319005)
+        assert_tol_equal(special.yv(-1,   1+0j), 0.7812128213002887)
+        assert_tol_equal(special.yv(-2,   1+0j), -1.650682606816255)
 
-        assert_tol_equal(iv(-1,   1+0j), 0.5651591039924851)
-        assert_tol_equal(iv(-2,   1+0j), 0.1357476697670383)
-        assert_tol_equal(kv(-1,   1+0j), 0.6019072301972347)
-        assert_tol_equal(kv(-2,   1+0j), 1.624838898635178)
+        assert_tol_equal(special.iv(-1,   1+0j), 0.5651591039924851)
+        assert_tol_equal(special.iv(-2,   1+0j), 0.1357476697670383)
+        assert_tol_equal(special.kv(-1,   1+0j), 0.6019072301972347)
+        assert_tol_equal(special.kv(-2,   1+0j), 1.624838898635178)
         
-        assert_tol_equal(jv(-0.5, 1+0j), 0.43109886801837607952)
-        assert_tol_equal(jv(-0.5, 1+1j), 0.2628946385649065-0.827050182040562j)
-        assert_tol_equal(yv(-0.5, 1+0j), 0.6713967071418031)
-        assert_tol_equal(yv(-0.5, 1+1j), 0.967901282890131+0.0602046062142816j)
+        assert_tol_equal(special.jv(-0.5, 1+0j), 0.43109886801837607952)
+        assert_tol_equal(special.jv(-0.5, 1+1j), 0.2628946385649065-0.827050182040562j)
+        assert_tol_equal(special.yv(-0.5, 1+0j), 0.6713967071418031)
+        assert_tol_equal(special.yv(-0.5, 1+1j), 0.967901282890131+0.0602046062142816j)
         
-        assert_tol_equal(iv(-0.5, 1+0j), 1.231200214592967)
-        assert_tol_equal(iv(-0.5, 1+1j), 0.77070737376928+0.39891821043561j)
-        assert_tol_equal(kv(-0.5, 1+0j), 0.4610685044478945)
-        assert_tol_equal(kv(-0.5, 1+1j), 0.06868578341999-0.38157825981268j)
+        assert_tol_equal(special.iv(-0.5, 1+0j), 1.231200214592967)
+        assert_tol_equal(special.iv(-0.5, 1+1j), 0.77070737376928+0.39891821043561j)
+        assert_tol_equal(special.kv(-0.5, 1+0j), 0.4610685044478945)
+        assert_tol_equal(special.kv(-0.5, 1+1j), 0.06868578341999-0.38157825981268j)
 
-        assert_tol_equal(jve(-0.5,1+0.3j), jv(-0.5, 1+0.3j)*exp(-0.3))
-        assert_tol_equal(yve(-0.5,1+0.3j), yv(-0.5, 1+0.3j)*exp(-0.3))
-        assert_tol_equal(ive(-0.5,0.3+1j), iv(-0.5, 0.3+1j)*exp(-0.3))
-        assert_tol_equal(kve(-0.5,0.3+1j), kv(-0.5, 0.3+1j)*exp(0.3+1j))
+        assert_tol_equal(special.jve(-0.5,1+0.3j), special.jv(-0.5, 1+0.3j)*exp(-0.3))
+        assert_tol_equal(special.yve(-0.5,1+0.3j), special.yv(-0.5, 1+0.3j)*exp(-0.3))
+        assert_tol_equal(special.ive(-0.5,0.3+1j), special.iv(-0.5, 0.3+1j)*exp(-0.3))
+        assert_tol_equal(special.kve(-0.5,0.3+1j), special.kv(-0.5, 0.3+1j)*exp(0.3+1j))
 
-        assert_tol_equal(hankel1(-0.5, 1+1j), jv(-0.5, 1+1j) + 1j*yv(-0.5,1+1j))
-        assert_tol_equal(hankel2(-0.5, 1+1j), jv(-0.5, 1+1j) - 1j*yv(-0.5,1+1j))
+        assert_tol_equal(special.hankel1(-0.5, 1+1j), special.jv(-0.5, 1+1j) + 1j*special.yv(-0.5,1+1j))
+        assert_tol_equal(special.hankel2(-0.5, 1+1j), special.jv(-0.5, 1+1j) - 1j*special.yv(-0.5,1+1j))
 
     def test_ticket_854(self):
         """Real-valued Bessel domains"""
-        assert isnan(jv(0.5, -1))
-        assert isnan(iv(0.5, -1))
-        assert isnan(yv(0.5, -1))
-        assert isnan(yv(1, -1))
-        assert isnan(kv(0.5, -1))
-        assert isnan(kv(1, -1))
-        assert isnan(jve(0.5, -1))
-        assert isnan(ive(0.5, -1))
-        assert isnan(yve(0.5, -1))
-        assert isnan(yve(1, -1))
-        assert isnan(kve(0.5, -1))
-        assert isnan(kve(1, -1))
-        assert isnan(airye(-1)[0:2]).all(), airye(-1)
-        assert not isnan(airye(-1)[2:4]).any(), airye(-1)
+        assert_(isnan(special.jv(0.5, -1)))
+        assert_(isnan(special.iv(0.5, -1)))
+        assert_(isnan(special.yv(0.5, -1)))
+        assert_(isnan(special.yv(1, -1)))
+        assert_(isnan(special.kv(0.5, -1)))
+        assert_(isnan(special.kv(1, -1)))
+        assert_(isnan(special.jve(0.5, -1)))
+        assert_(isnan(special.ive(0.5, -1)))
+        assert_(isnan(special.yve(0.5, -1)))
+        assert_(isnan(special.yve(1, -1)))
+        assert_(isnan(special.kve(0.5, -1)))
+        assert_(isnan(special.kve(1, -1)))
+        assert_(isnan(special.airye(-1)[0:2]).all(), special.airye(-1))
+        assert_(not isnan(special.airye(-1)[2:4]).any(), special.airye(-1))
 
     def test_ticket_503(self):
         """Real-valued Bessel I overflow"""
-        assert_tol_equal(iv(1, 700), 1.528500390233901e302)
-        assert_tol_equal(iv(1000, 1120), 1.301564549405821e301)
+        assert_tol_equal(special.iv(1, 700), 1.528500390233901e302)
+        assert_tol_equal(special.iv(1000, 1120), 1.301564549405821e301)
 
     def test_iv_hyperg_poles(self):
-        assert_tol_equal(iv(-0.5, 1), 1.231200214592967)
+        assert_tol_equal(special.iv(-0.5, 1), 1.231200214592967)
 
     def iv_series(self, v, z, n=200):
         k = arange(0, n).astype(float_)
-        r = (v+2*k)*log(.5*z) - gammaln(k+1) - gammaln(v+k+1)
+        r = (v+2*k)*log(.5*z) - special.gammaln(k+1) - special.gammaln(v+k+1)
         r[isnan(r)] = inf
         r = exp(r)
         err = abs(r).max() * finfo(float_).eps * n + abs(r[-1])*10
@@ -1709,18 +1716,18 @@
     def test_i0_series(self):
         for z in [1., 10., 200.5]:
             value, err = self.iv_series(0, z)
-            assert_tol_equal(i0(z), value, atol=err, err_msg=z)
+            assert_tol_equal(special.i0(z), value, atol=err, err_msg=z)
 
     def test_i1_series(self):
             for z in [1., 10., 200.5]:
                 value, err = self.iv_series(1, z)
-                assert_tol_equal(i1(z), value, atol=err, err_msg=z)
+                assert_tol_equal(special.i1(z), value, atol=err, err_msg=z)
 
     def test_iv_series(self):
         for v in [-20., -10., -1., 0., 1., 12.49, 120.]:
             for z in [1., 10., 200.5, -1+2j]:
                 value, err = self.iv_series(v, z)
-                assert_tol_equal(iv(v, z), value, atol=err, err_msg=(v, z))
+                assert_tol_equal(special.iv(v, z), value, atol=err, err_msg=(v, z))
 
     def test_i0(self):
         values = [[0.0, 1.0],
@@ -1733,12 +1740,12 @@
                   [20.0, 0.0897803119],
                  ]
         for i, (x, v) in enumerate(values):
-            cv = i0(x) * exp(-x)
+            cv = special.i0(x) * exp(-x)
             assert_almost_equal(cv, v, 8, err_msg='test #%d' % i)
 
     def test_i0e(self):
-        oize = i0e(.1)
-        oizer = ive(0,.1)
+        oize = special.i0e(.1)
+        oizer = special.ive(0,.1)
         assert_almost_equal(oize,oizer,8)
 
     def test_i1(self):
@@ -1751,51 +1758,51 @@
                   [20.0, 0.0875062222],
                  ]
         for i, (x, v) in enumerate(values):
-            cv = i1(x) * exp(-x)
+            cv = special.i1(x) * exp(-x)
             assert_almost_equal(cv, v, 8, err_msg='test #%d' % i)
 
     def test_i1e(self):
-        oi1e = i1e(.1)
-        oi1er = ive(1,.1)
+        oi1e = special.i1e(.1)
+        oi1er = special.ive(1,.1)
         assert_almost_equal(oi1e,oi1er,8)
 
     def test_iti0k0(self):
-        iti0 = array(iti0k0(5))
+        iti0 = array(special.iti0k0(5))
         assert_array_almost_equal(iti0,array([31.848667776169801, 1.5673873907283657]),5)
 
     def test_it2i0k0(self):
-        it2k = it2i0k0(.1)
+        it2k = special.it2i0k0(.1)
         assert_array_almost_equal(it2k,array([0.0012503906973464409, 3.3309450354686687]),6)
 
     def test_iv(self):
-        iv1 = iv(0,.1)*exp(-.1)
+        iv1 = special.iv(0,.1)*exp(-.1)
         assert_almost_equal(iv1,0.90710092578230106,10)
 
-    def test_negv(self):
-        assert_equal(ive(3,2), ive(-3,2))
+    def test_negv_ive(self):
+        assert_equal(special.ive(3,2), special.ive(-3,2))
 
     def test_ive(self):
-        ive1 = ive(0,.1)
-        iv1 = iv(0,.1)*exp(-.1)
+        ive1 = special.ive(0,.1)
+        iv1 = special.iv(0,.1)*exp(-.1)
         assert_almost_equal(ive1,iv1,10)
 
     def test_ivp0(self):
-        assert_almost_equal(iv(1,2), ivp(0,2), 10)
+        assert_almost_equal(special.iv(1,2), special.ivp(0,2), 10)
 
     def test_ivp(self):
-        y=(iv(0,2)+iv(2,2))/2
-        x = ivp(1,2)
+        y=(special.iv(0,2) + special.iv(2,2))/2
+        x = special.ivp(1,2)
         assert_almost_equal(x,y,10)
     
 
 class TestLaguerre(TestCase):
     def test_laguerre(self):
-        lag0 = laguerre(0)
-        lag1 = laguerre(1)
-        lag2 = laguerre(2)
-        lag3 = laguerre(3)
-        lag4 = laguerre(4)
-        lag5 = laguerre(5)
+        lag0 = special.laguerre(0)
+        lag1 = special.laguerre(1)
+        lag2 = special.laguerre(2)
+        lag3 = special.laguerre(3)
+        lag4 = special.laguerre(4)
+        lag5 = special.laguerre(5)
         assert_array_almost_equal(lag0.c,[1],13)
         assert_array_almost_equal(lag1.c,[-1,1],13)
         assert_array_almost_equal(lag2.c,array([1,-4,2])/2.0,13)
@@ -1805,10 +1812,10 @@
 
     def test_genlaguerre(self):
         k = 5*rand()-0.9
-        lag0 = genlaguerre(0,k)
-        lag1 = genlaguerre(1,k)
-        lag2 = genlaguerre(2,k)
-        lag3 = genlaguerre(3,k)
+        lag0 = special.genlaguerre(0,k)
+        lag1 = special.genlaguerre(1,k)
+        lag2 = special.genlaguerre(2,k)
+        lag3 = special.genlaguerre(3,k)
         assert_equal(lag0.c,[1])
         assert_equal(lag1.c,[-1,k+1])
         assert_almost_equal(lag2.c,array([1,-2*(k+2),(k+1.)*(k+2.)])/2.0)
@@ -1818,12 +1825,12 @@
 # Base polynomials come from Abrahmowitz and Stegan
 class TestLegendre(TestCase):
     def test_legendre(self):
-        leg0 = legendre(0)
-        leg1 = legendre(1)
-        leg2 = legendre(2)
-        leg3 = legendre(3)
-        leg4 = legendre(4)
-        leg5 = legendre(5)
+        leg0 = special.legendre(0)
+        leg1 = special.legendre(1)
+        leg2 = special.legendre(2)
+        leg3 = special.legendre(3)
+        leg4 = special.legendre(4)
+        leg5 = special.legendre(5)
         assert_equal(leg0.c,[1])
         assert_equal(leg1.c,[1,0])
         assert_equal(leg2.c,array([3,0,-1])/2.0)
@@ -1834,25 +1841,25 @@
 
 class TestLambda(TestCase):
     def test_lmbda(self):
-        lam = lmbda(1,.1)
-        lamr = (array([jn(0,.1), 2*jn(1,.1)/.1]),
-                array([jvp(0,.1), -2*jv(1,.1)/.01 + 2*jvp(1,.1)/.1]))
+        lam = special.lmbda(1,.1)
+        lamr = (array([special.jn(0,.1), 2*special.jn(1,.1)/.1]),
+                array([special.jvp(0,.1), -2*special.jv(1,.1)/.01 + 2*special.jvp(1,.1)/.1]))
         assert_array_almost_equal(lam,lamr,8)
 
 class TestLog1p(TestCase):
     def test_log1p(self):
-        l1p = (log1p(10),log1p(11),log1p(12))
-        l1prl = (log(11),log(12),log(13))
+        l1p = (special.log1p(10), special.log1p(11), special.log1p(12))
+        l1prl = (log(11), log(12), log(13))
         assert_array_almost_equal(l1p,l1prl,8)
 
     def test_log1pmore(self):
-        l1pm = (log1p(1),log1p(1.1),log1p(1.2))
+        l1pm = (special.log1p(1), special.log1p(1.1), special.log1p(1.2))
         l1pmrl = (log(2),log(2.1),log(2.2))
         assert_array_almost_equal(l1pm,l1pmrl,8)
 
 class TestLegendreFunctions(TestCase):
     def test_lpmn(self):
-        lp = lpmn(0,2,.5)
+        lp = special.lpmn(0,2,.5)
         assert_array_almost_equal(lp,(array([       [ 1.00000 ,
                                                       0.50000,
                                                       -0.12500]]),
@@ -1861,7 +1868,7 @@
                                                       1.50000]])),4)
 
     def test_lpn(self):
-        lpnf = lpn(2,.5)
+        lpnf = special.lpn(2,.5)
         assert_array_almost_equal(lpnf,(array(      [ 1.00000 ,
                                                         0.50000,
                                                         -0.12500]),
@@ -1870,27 +1877,27 @@
                                                       1.50000])),4)
 
     def test_lpmv(self):
-        lp = lpmv(0,2,.5)
+        lp = special.lpmv(0,2,.5)
         assert_almost_equal(lp,-0.125,3)
 
     def test_lqmn(self):
-        lqmnf = lqmn(0,2,.5)
-        lqmnf = lqmn(0,2,.5)
-        lqf = lqn(2,.5)
+        lqmnf = special.lqmn(0,2,.5)
+        lqmnf = special.lqmn(0,2,.5)
+        lqf = special.lqn(2,.5)
         assert_array_almost_equal(lqmnf[0][0],lqf[0],4)
         assert_array_almost_equal(lqmnf[1][0],lqf[1],4)
 
     def test_lqmn_shape(self):
-        a, b = lqmn(4, 4, 1.1)
+        a, b = special.lqmn(4, 4, 1.1)
         assert_equal(a.shape, (5, 5))
         assert_equal(b.shape, (5, 5))
 
-        a, b = lqmn(4, 0, 1.1)
+        a, b = special.lqmn(4, 0, 1.1)
         assert_equal(a.shape, (5, 1))
         assert_equal(b.shape, (5, 1))
 
     def test_lqn(self):
-        lqf = lqn(2,.5)
+        lqf = special.lqn(2,.5)
         assert_array_almost_equal(lqf,(array([ 0.5493, -0.7253, -0.8187]),
                                        array([ 1.3333,  1.216 , -0.8427])),4)
 
@@ -1900,7 +1907,7 @@
         pass
 
     def test_mathieu_even_coef(self):
-        mc =  mathieu_even_coef(2,5)
+        mc =  special.mathieu_even_coef(2,5)
         #Q not defined broken and cannot figure out proper reporting order
 
     def test_mathieu_odd_coef(self):
@@ -1917,7 +1924,7 @@
 
 class TestOblCvSeq(TestCase):
     def test_obl_cv_seq(self):
-        obl = obl_cv_seq(0,3,1)
+        obl = special.obl_cv_seq(0,3,1)
         assert_array_almost_equal(obl,array([ -0.348602,
                                               1.393206,
                                               5.486800,
@@ -1925,61 +1932,61 @@
 
 class TestParabolicCylinder(TestCase):
     def test_pbdn_seq(self):
-        pb = pbdn_seq(1,.1)
+        pb = special.pbdn_seq(1,.1)
         assert_array_almost_equal(pb,(array([ 0.9975,
                                               0.0998]),
                                       array([-0.0499,
                                              0.9925])),4)
 
     def test_pbdv(self):
-        pbv = pbdv(1,.2)
-        derrl = 1/2*(.2)*pbdv(1,.2)[0] - pbdv(0,.2)[0]
+        pbv = special.pbdv(1,.2)
+        derrl = 1/2*(.2)*special.pbdv(1,.2)[0] - special.pbdv(0,.2)[0]
 
     def test_pbdv_seq(self):
-        pbn = pbdn_seq(1,.1)
-        pbv = pbdv_seq(1,.1)
+        pbn = special.pbdn_seq(1,.1)
+        pbv = special.pbdv_seq(1,.1)
         assert_array_almost_equal(pbv,(real(pbn[0]),real(pbn[1])),4)
 
     def test_pbdv_points(self):
         # simple case
         eta = np.linspace(-10, 10, 5)
-        z = 2**(eta/2)*np.sqrt(np.pi)/gamma(.5-.5*eta)
-        assert_tol_equal(pbdv(eta, 0.)[0], z, rtol=1e-14, atol=1e-14)
+        z = 2**(eta/2)*np.sqrt(np.pi)/special.gamma(.5-.5*eta)
+        assert_tol_equal(special.pbdv(eta, 0.)[0], z, rtol=1e-14, atol=1e-14)
 
         # some points
-        assert_tol_equal(pbdv(10.34, 20.44)[0], 1.3731383034455e-32, rtol=1e-12)
-        assert_tol_equal(pbdv(-9.53, 3.44)[0], 3.166735001119246e-8, rtol=1e-12)
+        assert_tol_equal(special.pbdv(10.34, 20.44)[0], 1.3731383034455e-32, rtol=1e-12)
+        assert_tol_equal(special.pbdv(-9.53, 3.44)[0], 3.166735001119246e-8, rtol=1e-12)
 
     def test_pbdv_gradient(self):
         x = np.linspace(-4, 4, 8)[:,None]
         eta = np.linspace(-10, 10, 5)[None,:]
 
-        p = pbdv(eta, x)
+        p = special.pbdv(eta, x)
         eps = 1e-7 + 1e-7*abs(x)
-        dp = (pbdv(eta, x + eps)[0] - pbdv(eta, x - eps)[0]) / eps / 2.
+        dp = (special.pbdv(eta, x + eps)[0] - special.pbdv(eta, x - eps)[0]) / eps / 2.
         assert_tol_equal(p[1], dp, rtol=1e-6, atol=1e-6)
         
     def test_pbvv_gradient(self):
         x = np.linspace(-4, 4, 8)[:,None]
         eta = np.linspace(-10, 10, 5)[None,:]
 
-        p = pbvv(eta, x)
+        p = special.pbvv(eta, x)
         eps = 1e-7 + 1e-7*abs(x)
-        dp = (pbvv(eta, x + eps)[0] - pbvv(eta, x - eps)[0]) / eps / 2.
+        dp = (special.pbvv(eta, x + eps)[0] - special.pbvv(eta, x - eps)[0]) / eps / 2.
         assert_tol_equal(p[1], dp, rtol=1e-6, atol=1e-6)
         
 
 class TestPolygamma(TestCase):
     # from Table 6.2 (pg. 271) of A&S
     def test_polygamma(self):
-        poly2 = polygamma(2,1)
-        poly3 = polygamma(3,1)
+        poly2 = special.polygamma(2,1)
+        poly3 = special.polygamma(3,1)
         assert_almost_equal(poly2,-2.4041138063,10)
         assert_almost_equal(poly3,6.4939394023,10)
 
 class TestProCvSeq(TestCase):
     def test_pro_cv_seq(self):
-        prol = pro_cv_seq(0,3,1)
+        prol = special.pro_cv_seq(0,3,1)
         assert_array_almost_equal(prol,array([  0.319000,
                                                2.593084,
                                                6.533471,
@@ -1987,32 +1994,32 @@
 
 class TestPsi(TestCase):
     def test_psi(self):
-        ps = psi(1)
+        ps = special.psi(1)
         assert_almost_equal(ps,-0.57721566490153287,8)
 
 class TestRadian(TestCase):
     def test_radian(self):
-        rad = radian(90,0,0)
+        rad = special.radian(90,0,0)
         assert_almost_equal(rad,pi/2.0,5)
 
     def test_radianmore(self):
-        rad1 = radian(90,1,60)
+        rad1 = special.radian(90,1,60)
         assert_almost_equal(rad1,pi/2+0.0005816135199345904,5)
 
 class TestRiccati(TestCase):
     def test_riccati_jn(self):
-        jnrl = (sph_jn(1,.2)[0]*.2,sph_jn(1,.2)[0]+sph_jn(1,.2)[1]*.2)
-        ricjn = riccati_jn(1,.2)
+        jnrl = (special.sph_jn(1,.2)[0]*.2,special.sph_jn(1,.2)[0]+special.sph_jn(1,.2)[1]*.2)
+        ricjn = special.riccati_jn(1,.2)
         assert_array_almost_equal(ricjn,jnrl,8)
 
     def test_riccati_yn(self):
-        ynrl = (sph_yn(1,.2)[0]*.2,sph_yn(1,.2)[0]+sph_yn(1,.2)[1]*.2)
-        ricyn = riccati_yn(1,.2)
+        ynrl = (special.sph_yn(1,.2)[0]*.2,special.sph_yn(1,.2)[0]+special.sph_yn(1,.2)[1]*.2)
+        ricyn = special.riccati_yn(1,.2)
         assert_array_almost_equal(ricyn,ynrl,8)
 
 class TestRound(TestCase):
     def test_round(self):
-        rnd = map(int,(round(10.1),round(10.4),round(10.5),round(10.6)))
+        rnd = map(int,(special.round(10.1),special.round(10.4),special.round(10.5),special.round(10.6)))
 
         # Note: According to the documentation, scipy.special.round is
         # supposed to round to the nearest even number if the fractional
@@ -2026,7 +2033,7 @@
 def test_sph_harm():
     # Tests derived from tables in
     # http://en.wikipedia.org/wiki/Table_of_spherical_harmonics
-    sh = sph_harm
+    sh = special.sph_harm
     pi = np.pi
     exp = np.exp
     sqrt = np.sqrt
@@ -2058,7 +2065,7 @@
         pass
     
     def test_sph_in(self):
-        i1n = sph_in(1,.2)
+        i1n = special.sph_in(1,.2)
         inp0 = (i1n[0][1])
         inp1 = (i1n[0][0] - 2.0/0.2 * i1n[0][1])
         assert_array_almost_equal(i1n[0],array([1.0066800127054699381,
@@ -2066,12 +2073,12 @@
         assert_array_almost_equal(i1n[1],[inp0,inp1],12)
 
     def test_sph_inkn(self):
-        spikn = r_[sph_in(1,.2)+sph_kn(1,.2)]
-        inkn = r_[sph_inkn(1,.2)]
+        spikn = r_[special.sph_in(1,.2) + special.sph_kn(1,.2)]
+        inkn = r_[special.sph_inkn(1,.2)]
         assert_array_almost_equal(inkn,spikn,10)
 
     def test_sph_jn(self):
-        s1 = sph_jn(2,.2)
+        s1 = special.sph_jn(2,.2)
         s10 = -s1[0][1]
         s11 = s1[0][0]-2.0/0.2*s1[0][1]
         s12 = s1[0][1]-3.0/0.2*s1[0][2]
@@ -2081,12 +2088,12 @@
         assert_array_almost_equal(s1[1],[s10,s11,s12],12)
 
     def test_sph_jnyn(self):
-        jnyn = r_[sph_jn(1,.2) + sph_yn(1,.2)]  # tuple addition
-        jnyn1 = r_[sph_jnyn(1,.2)]
+        jnyn = r_[special.sph_jn(1,.2) + special.sph_yn(1,.2)]  # tuple addition
+        jnyn1 = r_[special.sph_jnyn(1,.2)]
         assert_array_almost_equal(jnyn1,jnyn,9)
 
     def test_sph_kn(self):
-        kn = sph_kn(2,.2)
+        kn = special.sph_kn(2,.2)
         kn0 = -kn[0][1]
         kn1 = -kn[0][0]-2.0/0.2*kn[0][1]
         kn2 = -kn[0][1]-3.0/0.2*kn[0][2]
@@ -2096,19 +2103,19 @@
         assert_array_almost_equal(kn[1],[kn0,kn1,kn2],9)
 
     def test_sph_yn(self):
-        sy1 = sph_yn(2,.2)[0][2]
-        sy2 = sph_yn(0,.2)[0][0]
-        sphpy = (sph_yn(1,.2)[0][0]-2*sph_yn(2,.2)[0][2])/3 #correct derivative value
+        sy1 = special.sph_yn(2,.2)[0][2]
+        sy2 = special.sph_yn(0,.2)[0][0]
+        sphpy = (special.sph_yn(1,.2)[0][0]-2*special.sph_yn(2,.2)[0][2])/3 #correct derivative value
         assert_almost_equal(sy1,-377.52483,5)#previous values in the system
         assert_almost_equal(sy2,-4.9003329,5)
-        sy3 = sph_yn(1,.2)[1][1]
+        sy3 = special.sph_yn(1,.2)[1][1]
         assert_almost_equal(sy3,sphpy,4) #compare correct derivative val. (correct =-system val).
 
 class TestStruve(object):
     def _series(self, v, z, n=100):
         """Compute Struve function & error estimate from its power series."""
         k = arange(0, n)
-        r = (-1)**k * (.5*z)**(2*k+v+1)/gamma(k+1.5)/gamma(k+v+1.5)
+        r = (-1)**k * (.5*z)**(2*k+v+1)/special.gamma(k+1.5)/special.gamma(k+v+1.5)
         err = abs(r).max() * finfo(float_).eps * n
         return r.sum(), err
 
@@ -2117,35 +2124,35 @@
         for v in [-20, -10, -7.99, -3.4, -1, 0, 1, 3.4, 12.49, 16]:
             for z in [1, 10, 19, 21, 30]:
                 value, err = self._series(v, z)
-                assert_tol_equal(struve(v, z), value, rtol=0, atol=err), (v, z)
+                assert_tol_equal(special.struve(v, z), value, rtol=0, atol=err), (v, z)
 
     def test_some_values(self):
-        assert_tol_equal(struve(-7.99, 21), 0.0467547614113, rtol=1e-7)
-        assert_tol_equal(struve(-8.01, 21), 0.0398716951023, rtol=1e-8)
-        assert_tol_equal(struve(-3.0, 200), 0.0142134427432, rtol=1e-12)
-        assert_tol_equal(struve(-8.0, -41), 0.0192469727846, rtol=1e-11)
-        assert_equal(struve(-12, -41), -struve(-12, 41))
-        assert_equal(struve(+12, -41), -struve(+12, 41))
-        assert_equal(struve(-11, -41), +struve(-11, 41))
-        assert_equal(struve(+11, -41), +struve(+11, 41))
+        assert_tol_equal(special.struve(-7.99, 21), 0.0467547614113, rtol=1e-7)
+        assert_tol_equal(special.struve(-8.01, 21), 0.0398716951023, rtol=1e-8)
+        assert_tol_equal(special.struve(-3.0, 200), 0.0142134427432, rtol=1e-12)
+        assert_tol_equal(special.struve(-8.0, -41), 0.0192469727846, rtol=1e-11)
+        assert_equal(special.struve(-12, -41), -special.struve(-12, 41))
+        assert_equal(special.struve(+12, -41), -special.struve(+12, 41))
+        assert_equal(special.struve(-11, -41), +special.struve(-11, 41))
+        assert_equal(special.struve(+11, -41), +special.struve(+11, 41))
 
-        assert isnan(struve(-7.1, -1))
-        assert isnan(struve(-10.1, -1))
+        assert_(isnan(special.struve(-7.1, -1)))
+        assert_(isnan(special.struve(-10.1, -1)))
 
     def test_regression_679(self):
         """Regression test for #679"""
-        assert_tol_equal(struve(-1.0, 20 - 1e-8), struve(-1.0, 20 + 1e-8))
-        assert_tol_equal(struve(-2.0, 20 - 1e-8), struve(-2.0, 20 + 1e-8))
-        assert_tol_equal(struve(-4.3, 20 - 1e-8), struve(-4.3, 20 + 1e-8))
+        assert_tol_equal(special.struve(-1.0, 20 - 1e-8), special.struve(-1.0, 20 + 1e-8))
+        assert_tol_equal(special.struve(-2.0, 20 - 1e-8), special.struve(-2.0, 20 + 1e-8))
+        assert_tol_equal(special.struve(-4.3, 20 - 1e-8), special.struve(-4.3, 20 + 1e-8))
 
 def test_chi2_smalldf():
-    assert_almost_equal(chdtr(0.6,3), 0.957890536704110)
+    assert_almost_equal(special.chdtr(0.6,3), 0.957890536704110)
 
 def test_chi2c_smalldf():
-    assert_almost_equal(chdtrc(0.6,3), 1-0.957890536704110)
+    assert_almost_equal(special.chdtrc(0.6,3), 1-0.957890536704110)
 
 def test_chi2_inv_smalldf():
-    assert_almost_equal(chdtri(0.6,1-0.957890536704110), 3)
+    assert_almost_equal(special.chdtri(0.6,1-0.957890536704110), 3)
 
 
 if __name__ == "__main__":

Modified: trunk/scipy/special/tests/test_data.py
===================================================================
--- trunk/scipy/special/tests/test_data.py	2010-09-12 21:29:13 UTC (rev 6799)
+++ trunk/scipy/special/tests/test_data.py	2010-09-12 21:30:28 UTC (rev 6800)
@@ -1,7 +1,6 @@
 import os
 
 import numpy as np
-from numpy.testing import *
 from scipy.special import (
     arccosh, arcsinh, arctanh, erf, erfc, log1p, expm1,
     jn, jv, yn, yv, iv, kv, kn, gamma, gammaln, digamma, beta, cbrt,
@@ -9,7 +8,7 @@
     zeta, gammaincinv,
 )
 
-from testutils import *
+from testutils import FuncData
 
 DATASETS = np.load(os.path.join(os.path.dirname(__file__),
                                 "data", "boost.npz"))

Modified: trunk/scipy/special/tests/test_lambertw.py
===================================================================
--- trunk/scipy/special/tests/test_lambertw.py	2010-09-12 21:29:13 UTC (rev 6799)
+++ trunk/scipy/special/tests/test_lambertw.py	2010-09-12 21:30:28 UTC (rev 6800)
@@ -6,14 +6,15 @@
 # [1] mpmath source code, Subversion revision 992
 #     http://code.google.com/p/mpmath/source/browse/trunk/mpmath/tests/test_functions2.py?spec=svn994&r=992
 
-from numpy.testing import *
+from numpy.testing import assert_, assert_equal, assert_array_almost_equal
 from scipy.special import lambertw
 from numpy import nan, inf, pi, e, isnan, log, r_, array, complex_
 
-from testutils import *
+from testutils import FuncData
 
+
 def test_values():
-    assert isnan(lambertw(nan))
+    assert_(isnan(lambertw(nan)))
     assert_equal(lambertw(inf,1).real, inf)
     assert_equal(lambertw(inf,1).imag, 2*pi)
     assert_equal(lambertw(-inf,1).real, inf)

Modified: trunk/scipy/special/tests/test_mpmath.py
===================================================================
--- trunk/scipy/special/tests/test_mpmath.py	2010-09-12 21:29:13 UTC (rev 6799)
+++ trunk/scipy/special/tests/test_mpmath.py	2010-09-12 21:30:28 UTC (rev 6800)
@@ -4,10 +4,10 @@
 """
 import re
 import numpy as np
-from numpy.testing import *
+from numpy.testing import dec
 import scipy.special as sc
 
-from testutils import *
+from testutils import FuncData, assert_func_equal
 
 try:
     import mpmath

Modified: trunk/scipy/special/tests/test_orthogonal.py
===================================================================
--- trunk/scipy/special/tests/test_orthogonal.py	2010-09-12 21:29:13 UTC (rev 6799)
+++ trunk/scipy/special/tests/test_orthogonal.py	2010-09-12 21:30:28 UTC (rev 6800)
@@ -1,20 +1,19 @@
-from numpy.testing import *
+from numpy.testing import assert_array_almost_equal, assert_almost_equal, \
+        rand, TestCase
 import numpy as np
 from numpy import array, sqrt
-from scipy.special.orthogonal import *
+import scipy.special.orthogonal as orth
 from scipy.special import gamma
 
-from testutils import *
 
-
 class TestCheby(TestCase):
     def test_chebyc(self):
-        C0 = chebyc(0)
-        C1 = chebyc(1)
-        C2 = chebyc(2)
-        C3 = chebyc(3)
-        C4 = chebyc(4)
-        C5 = chebyc(5)
+        C0 = orth.chebyc(0)
+        C1 = orth.chebyc(1)
+        C2 = orth.chebyc(2)
+        C3 = orth.chebyc(3)
+        C4 = orth.chebyc(4)
+        C5 = orth.chebyc(5)
 
         assert_array_almost_equal(C0.c,[2],13)
         assert_array_almost_equal(C1.c,[1,0],13)
@@ -24,12 +23,12 @@
         assert_array_almost_equal(C5.c,[1,0,-5,0,5,0],13)
 
     def test_chebys(self):
-        S0 = chebys(0)
-        S1 = chebys(1)
-        S2 = chebys(2)
-        S3 = chebys(3)
-        S4 = chebys(4)
-        S5 = chebys(5)
+        S0 = orth.chebys(0)
+        S1 = orth.chebys(1)
+        S2 = orth.chebys(2)
+        S3 = orth.chebys(3)
+        S4 = orth.chebys(4)
+        S5 = orth.chebys(5)
         assert_array_almost_equal(S0.c,[1],13)
         assert_array_almost_equal(S1.c,[1,0],13)
         assert_array_almost_equal(S2.c,[1,0,-1],13)
@@ -38,12 +37,12 @@
         assert_array_almost_equal(S5.c,[1,0,-4,0,3,0],13)
 
     def test_chebyt(self):
-        T0 = chebyt(0)
-        T1 = chebyt(1)
-        T2 = chebyt(2)
-        T3 = chebyt(3)
-        T4 = chebyt(4)
-        T5 = chebyt(5)
+        T0 = orth.chebyt(0)
+        T1 = orth.chebyt(1)
+        T2 = orth.chebyt(2)
+        T3 = orth.chebyt(3)
+        T4 = orth.chebyt(4)
+        T5 = orth.chebyt(5)
         assert_array_almost_equal(T0.c,[1],13)
         assert_array_almost_equal(T1.c,[1,0],13)
         assert_array_almost_equal(T2.c,[2,0,-1],13)
@@ -52,12 +51,12 @@
         assert_array_almost_equal(T5.c,[16,0,-20,0,5,0],13)
 
     def test_chebyu(self):
-        U0 = chebyu(0)
-        U1 = chebyu(1)
-        U2 = chebyu(2)
-        U3 = chebyu(3)
-        U4 = chebyu(4)
-        U5 = chebyu(5)
+        U0 = orth.chebyu(0)
+        U1 = orth.chebyu(1)
+        U2 = orth.chebyu(2)
+        U3 = orth.chebyu(3)
+        U4 = orth.chebyu(4)
+        U5 = orth.chebyu(5)
         assert_array_almost_equal(U0.c,[1],13)
         assert_array_almost_equal(U1.c,[2,0],13)
         assert_array_almost_equal(U2.c,[4,0,-1],13)
@@ -70,31 +69,31 @@
     def test_gegenbauer(self):
         a = 5*rand()-0.5
         if np.any(a==0): a = -0.2
-        Ca0 = gegenbauer(0,a)
-        Ca1 = gegenbauer(1,a)
-        Ca2 = gegenbauer(2,a)
-        Ca3 = gegenbauer(3,a)
-        Ca4 = gegenbauer(4,a)
-        Ca5 = gegenbauer(5,a)
+        Ca0 = orth.gegenbauer(0,a)
+        Ca1 = orth.gegenbauer(1,a)
+        Ca2 = orth.gegenbauer(2,a)
+        Ca3 = orth.gegenbauer(3,a)
+        Ca4 = orth.gegenbauer(4,a)
+        Ca5 = orth.gegenbauer(5,a)
 
         assert_array_almost_equal(Ca0.c,array([1]),13)
         assert_array_almost_equal(Ca1.c,array([2*a,0]),13)
         assert_array_almost_equal(Ca2.c,array([2*a*(a+1),0,-a]),13)
-        assert_array_almost_equal(Ca3.c,array([4*poch(a,3),0,-6*a*(a+1),
+        assert_array_almost_equal(Ca3.c,array([4*orth.poch(a,3),0,-6*a*(a+1),
                                                0])/3.0,11)
-        assert_array_almost_equal(Ca4.c,array([4*poch(a,4),0,-12*poch(a,3),
+        assert_array_almost_equal(Ca4.c,array([4*orth.poch(a,4),0,-12*orth.poch(a,3),
                                                0,3*a*(a+1)])/6.0,11)
-        assert_array_almost_equal(Ca5.c,array([4*poch(a,5),0,-20*poch(a,4),
-                                               0,15*poch(a,3),0])/15.0,11)
+        assert_array_almost_equal(Ca5.c,array([4*orth.poch(a,5),0,-20*orth.poch(a,4),
+                                               0,15*orth.poch(a,3),0])/15.0,11)
 
 class TestHermite(TestCase):
     def test_hermite(self):
-        H0 = hermite(0)
-        H1 = hermite(1)
-        H2 = hermite(2)
-        H3 = hermite(3)
-        H4 = hermite(4)
-        H5 = hermite(5)
+        H0 = orth.hermite(0)
+        H1 = orth.hermite(1)
+        H2 = orth.hermite(2)
+        H3 = orth.hermite(3)
+        H4 = orth.hermite(4)
+        H5 = orth.hermite(5)
         assert_array_almost_equal(H0.c,[1],13)
         assert_array_almost_equal(H1.c,[2,0],13)
         assert_array_almost_equal(H2.c,[4,0,-2],13)
@@ -105,18 +104,18 @@
     def test_hermitenorm(self):
         # He_n(x) = 2**(-n/2) H_n(x/sqrt(2))
         psub = np.poly1d([1.0/sqrt(2),0])
-        H0 = hermitenorm(0)
-        H1 = hermitenorm(1)
-        H2 = hermitenorm(2)
-        H3 = hermitenorm(3)
-        H4 = hermitenorm(4)
-        H5 = hermitenorm(5)
-        he0 = hermite(0)(psub)
-        he1 = hermite(1)(psub) / sqrt(2)
-        he2 = hermite(2)(psub) / 2.0
-        he3 = hermite(3)(psub) / (2*sqrt(2))
-        he4 = hermite(4)(psub) / 4.0
-        he5 = hermite(5)(psub) / (4.0*sqrt(2))
+        H0 = orth.hermitenorm(0)
+        H1 = orth.hermitenorm(1)
+        H2 = orth.hermitenorm(2)
+        H3 = orth.hermitenorm(3)
+        H4 = orth.hermitenorm(4)
+        H5 = orth.hermitenorm(5)
+        he0 = orth.hermite(0)(psub)
+        he1 = orth.hermite(1)(psub) / sqrt(2)
+        he2 = orth.hermite(2)(psub) / 2.0
+        he3 = orth.hermite(3)(psub) / (2*sqrt(2))
+        he4 = orth.hermite(4)(psub) / 4.0
+        he5 = orth.hermite(5)(psub) / (4.0*sqrt(2))
 
         assert_array_almost_equal(H0.c,he0.c,13)
         assert_array_almost_equal(H1.c,he1.c,13)
@@ -130,18 +129,18 @@
     def test_sh_legendre(self):
         # P*_n(x) = P_n(2x-1)
         psub = np.poly1d([2,-1])
-        Ps0 = sh_legendre(0)
-        Ps1 = sh_legendre(1)
-        Ps2 = sh_legendre(2)
-        Ps3 = sh_legendre(3)
-        Ps4 = sh_legendre(4)
-        Ps5 = sh_legendre(5)
-        pse0 = legendre(0)(psub)
-        pse1 = legendre(1)(psub)
-        pse2 = legendre(2)(psub)
-        pse3 = legendre(3)(psub)
-        pse4 = legendre(4)(psub)
-        pse5 = legendre(5)(psub)
+        Ps0 = orth.sh_legendre(0)
+        Ps1 = orth.sh_legendre(1)
+        Ps2 = orth.sh_legendre(2)
+        Ps3 = orth.sh_legendre(3)
+        Ps4 = orth.sh_legendre(4)
+        Ps5 = orth.sh_legendre(5)
+        pse0 = orth.legendre(0)(psub)
+        pse1 = orth.legendre(1)(psub)
+        pse2 = orth.legendre(2)(psub)
+        pse3 = orth.legendre(3)(psub)
+        pse4 = orth.legendre(4)(psub)
+        pse5 = orth.legendre(5)(psub)
         assert_array_almost_equal(Ps0.c,pse0.c,13)
         assert_array_almost_equal(Ps1.c,pse1.c,13)
         assert_array_almost_equal(Ps2.c,pse2.c,13)
@@ -154,18 +153,18 @@
     def test_sh_chebyt(self):
         # T*_n(x) = T_n(2x-1)
         psub = np.poly1d([2,-1])
-        Ts0 = sh_chebyt(0)
-        Ts1 = sh_chebyt(1)
-        Ts2 = sh_chebyt(2)
-        Ts3 = sh_chebyt(3)
-        Ts4 = sh_chebyt(4)
-        Ts5 = sh_chebyt(5)
-        tse0 = chebyt(0)(psub)
-        tse1 = chebyt(1)(psub)
-        tse2 = chebyt(2)(psub)
-        tse3 = chebyt(3)(psub)
-        tse4 = chebyt(4)(psub)
-        tse5 = chebyt(5)(psub)
+        Ts0 = orth.sh_chebyt(0)
+        Ts1 = orth.sh_chebyt(1)
+        Ts2 = orth.sh_chebyt(2)
+        Ts3 = orth.sh_chebyt(3)
+        Ts4 = orth.sh_chebyt(4)
+        Ts5 = orth.sh_chebyt(5)
+        tse0 = orth.chebyt(0)(psub)
+        tse1 = orth.chebyt(1)(psub)
+        tse2 = orth.chebyt(2)(psub)
+        tse3 = orth.chebyt(3)(psub)
+        tse4 = orth.chebyt(4)(psub)
+        tse5 = orth.chebyt(5)(psub)
         assert_array_almost_equal(Ts0.c,tse0.c,13)
         assert_array_almost_equal(Ts1.c,tse1.c,13)
         assert_array_almost_equal(Ts2.c,tse2.c,13)
@@ -178,18 +177,18 @@
     def test_sh_chebyu(self):
         # U*_n(x) = U_n(2x-1)
         psub = np.poly1d([2,-1])
-        Us0 = sh_chebyu(0)
-        Us1 = sh_chebyu(1)
-        Us2 = sh_chebyu(2)
-        Us3 = sh_chebyu(3)
-        Us4 = sh_chebyu(4)
-        Us5 = sh_chebyu(5)
-        use0 = chebyu(0)(psub)
-        use1 = chebyu(1)(psub)
-        use2 = chebyu(2)(psub)
-        use3 = chebyu(3)(psub)
-        use4 = chebyu(4)(psub)
-        use5 = chebyu(5)(psub)
+        Us0 = orth.sh_chebyu(0)
+        Us1 = orth.sh_chebyu(1)
+        Us2 = orth.sh_chebyu(2)
+        Us3 = orth.sh_chebyu(3)
+        Us4 = orth.sh_chebyu(4)
+        Us5 = orth.sh_chebyu(5)
+        use0 = orth.chebyu(0)(psub)
+        use1 = orth.chebyu(1)(psub)
+        use2 = orth.chebyu(2)(psub)
+        use3 = orth.chebyu(3)(psub)
+        use4 = orth.chebyu(4)(psub)
+        use5 = orth.chebyu(5)(psub)
         assert_array_almost_equal(Us0.c,use0.c,13)
         assert_array_almost_equal(Us1.c,use1.c,13)
         assert_array_almost_equal(Us2.c,use2.c,13)
@@ -205,18 +204,18 @@
         q = 4*rand()
         p = q-1 + 2*rand()
         #print "shifted jacobi p,q = ", p, q
-        G0 = sh_jacobi(0,p,q)
-        G1 = sh_jacobi(1,p,q)
-        G2 = sh_jacobi(2,p,q)
-        G3 = sh_jacobi(3,p,q)
-        G4 = sh_jacobi(4,p,q)
-        G5 = sh_jacobi(5,p,q)
-        ge0 = jacobi(0,p-q,q-1)(psub) * conv(0,p)
-        ge1 = jacobi(1,p-q,q-1)(psub) * conv(1,p)
-        ge2 = jacobi(2,p-q,q-1)(psub) * conv(2,p)
-        ge3 = jacobi(3,p-q,q-1)(psub) * conv(3,p)
-        ge4 = jacobi(4,p-q,q-1)(psub) * conv(4,p)
-        ge5 = jacobi(5,p-q,q-1)(psub) * conv(5,p)
+        G0 = orth.sh_jacobi(0,p,q)
+        G1 = orth.sh_jacobi(1,p,q)
+        G2 = orth.sh_jacobi(2,p,q)
+        G3 = orth.sh_jacobi(3,p,q)
+        G4 = orth.sh_jacobi(4,p,q)
+        G5 = orth.sh_jacobi(5,p,q)
+        ge0 = orth.jacobi(0,p-q,q-1)(psub) * conv(0,p)
+        ge1 = orth.jacobi(1,p-q,q-1)(psub) * conv(1,p)
+        ge2 = orth.jacobi(2,p-q,q-1)(psub) * conv(2,p)
+        ge3 = orth.jacobi(3,p-q,q-1)(psub) * conv(3,p)
+        ge4 = orth.jacobi(4,p-q,q-1)(psub) * conv(4,p)
+        ge5 = orth.jacobi(5,p-q,q-1)(psub) * conv(5,p)
 
         assert_array_almost_equal(G0.c,ge0.c,13)
         assert_array_almost_equal(G1.c,ge1.c,13)
@@ -231,21 +230,21 @@
         for n in xrange(5):
             poly.extend([x.strip() for x in
                 ("""
-                jacobi(%(n)d,0.3,0.9)
-                sh_jacobi(%(n)d,0.3,0.9)
-                genlaguerre(%(n)d,0.3)
-                laguerre(%(n)d)
-                hermite(%(n)d)
-                hermitenorm(%(n)d)
-                gegenbauer(%(n)d,0.3)
-                chebyt(%(n)d)
-                chebyu(%(n)d)
-                chebyc(%(n)d)
-                chebys(%(n)d)
-                sh_chebyt(%(n)d)
-                sh_chebyu(%(n)d)
-                legendre(%(n)d)
-                sh_legendre(%(n)d)
+                orth.jacobi(%(n)d,0.3,0.9)
+                orth.sh_jacobi(%(n)d,0.3,0.9)
+                orth.genlaguerre(%(n)d,0.3)
+                orth.laguerre(%(n)d)
+                orth.hermite(%(n)d)
+                orth.hermitenorm(%(n)d)
+                orth.gegenbauer(%(n)d,0.3)
+                orth.chebyt(%(n)d)
+                orth.chebyu(%(n)d)
+                orth.chebyc(%(n)d)
+                orth.chebys(%(n)d)
+                orth.sh_chebyt(%(n)d)
+                orth.sh_chebyu(%(n)d)
+                orth.legendre(%(n)d)
+                orth.sh_legendre(%(n)d)
                 """ % dict(n=n)).split()
             ])
         for pstr in poly:

Modified: trunk/scipy/special/tests/test_orthogonal_eval.py
===================================================================
--- trunk/scipy/special/tests/test_orthogonal_eval.py	2010-09-12 21:29:13 UTC (rev 6799)
+++ trunk/scipy/special/tests/test_orthogonal_eval.py	2010-09-12 21:30:28 UTC (rev 6800)
@@ -1,18 +1,20 @@
-from numpy.testing import *
+#from numpy.testing import 
+
 import numpy as np
-from numpy import array, sqrt
-from scipy.special.orthogonal import *
-from scipy.special import gamma
+from numpy.testing import assert_
+import scipy.special.orthogonal as orth
 
-from testutils import *
+from testutils import FuncData
 
+
 def test_eval_chebyt():
     n = np.arange(0, 10000, 7)
     x = 2*np.random.rand() - 1
     v1 = np.cos(n*np.arccos(x))
-    v2 = eval_chebyt(n, x)
-    assert np.allclose(v1, v2, rtol=1e-15)
+    v2 = orth.eval_chebyt(n, x)
+    assert_(np.allclose(v1, v2, rtol=1e-15))
 
+
 class TestPolys(object):
     """
     Check that the eval_* functions agree with the constructed polynomials
@@ -50,64 +52,64 @@
         ds.check()
 
     def test_jacobi(self):
-        self.check_poly(eval_jacobi, jacobi,
+        self.check_poly(orth.eval_jacobi, orth.jacobi,
                    param_ranges=[(-0.99, 10), (-0.99, 10)], x_range=[-1, 1],
                    rtol=1e-5)
 
     def test_sh_jacobi(self):
-        self.check_poly(eval_sh_jacobi, sh_jacobi,
+        self.check_poly(orth.eval_sh_jacobi, orth.sh_jacobi,
                    param_ranges=[(1, 10), (0, 1)], x_range=[0, 1],
                    rtol=1e-5)
 
     def test_gegenbauer(self):
-        self.check_poly(eval_gegenbauer, gegenbauer,
+        self.check_poly(orth.eval_gegenbauer, orth.gegenbauer,
                    param_ranges=[(-0.499, 10)], x_range=[-1, 1],
                    rtol=1e-7)
 
     def test_chebyt(self):
-        self.check_poly(eval_chebyt, chebyt,
+        self.check_poly(orth.eval_chebyt, orth.chebyt,
                    param_ranges=[], x_range=[-1, 1])
 
     def test_chebyu(self):
-        self.check_poly(eval_chebyu, chebyu,
+        self.check_poly(orth.eval_chebyu, orth.chebyu,
                    param_ranges=[], x_range=[-1, 1])
 
     def test_chebys(self):
-        self.check_poly(eval_chebys, chebys,
+        self.check_poly(orth.eval_chebys, orth.chebys,
                    param_ranges=[], x_range=[-2, 2])
 
     def test_chebyc(self):
-        self.check_poly(eval_chebyc, chebyc,
+        self.check_poly(orth.eval_chebyc, orth.chebyc,
                    param_ranges=[], x_range=[-2, 2])
 
     def test_sh_chebyt(self):
-        self.check_poly(eval_sh_chebyt, sh_chebyt,
+        self.check_poly(orth.eval_sh_chebyt, orth.sh_chebyt,
                    param_ranges=[], x_range=[0, 1])
 
     def test_sh_chebyu(self):
-        self.check_poly(eval_sh_chebyu, sh_chebyu,
+        self.check_poly(orth.eval_sh_chebyu, orth.sh_chebyu,
                    param_ranges=[], x_range=[0, 1])
 
     def test_legendre(self):
-        self.check_poly(eval_legendre, legendre,
+        self.check_poly(orth.eval_legendre, orth.legendre,
                    param_ranges=[], x_range=[-1, 1])
 
     def test_sh_legendre(self):
-        self.check_poly(eval_sh_legendre, sh_legendre,
+        self.check_poly(orth.eval_sh_legendre, orth.sh_legendre,
                    param_ranges=[], x_range=[0, 1])
 
     def test_genlaguerre(self):
-        self.check_poly(eval_genlaguerre, genlaguerre,
+        self.check_poly(orth.eval_genlaguerre, orth.genlaguerre,
                    param_ranges=[(-0.99, 10)], x_range=[0, 100])
 
     def test_laguerre(self):
-        self.check_poly(eval_laguerre, laguerre,
+        self.check_poly(orth.eval_laguerre, orth.laguerre,
                    param_ranges=[], x_range=[0, 100])
 
     def test_hermite(self):
-        self.check_poly(eval_hermite, hermite,
+        self.check_poly(orth.eval_hermite, orth.hermite,
                    param_ranges=[], x_range=[-100, 100])
 
     def test_hermitenorm(self):
-        self.check_poly(eval_hermitenorm, hermitenorm,
+        self.check_poly(orth.eval_hermitenorm, orth.hermitenorm,
                         param_ranges=[], x_range=[-100, 100])

Modified: trunk/scipy/special/tests/test_spfun_stats.py
===================================================================
--- trunk/scipy/special/tests/test_spfun_stats.py	2010-09-12 21:29:13 UTC (rev 6799)
+++ trunk/scipy/special/tests/test_spfun_stats.py	2010-09-12 21:30:28 UTC (rev 6800)
@@ -1,8 +1,9 @@
 import numpy as np
-from numpy.testing import *
+from numpy.testing import assert_array_equal, TestCase, run_module_suite
 
 from scipy.special import gammaln, multigammaln
 
+
 class TestMultiGammaLn(TestCase):
     def test1(self):
         a = np.abs(np.random.randn())

Modified: trunk/scipy/special/tests/testutils.py
===================================================================
--- trunk/scipy/special/tests/testutils.py	2010-09-12 21:29:13 UTC (rev 6799)
+++ trunk/scipy/special/tests/testutils.py	2010-09-12 21:30:28 UTC (rev 6800)
@@ -2,6 +2,7 @@
 import warnings
 
 import numpy as np
+from numpy.testing import assert_
 from numpy.testing.noseclasses import KnownFailureTest
 
 import scipy.special as sc
@@ -180,7 +181,7 @@
 
         # Check the validity of each output returned
 
-        assert len(got) == len(wanted)
+        assert_(len(got) == len(wanted))
 
         for output_num, (x, y) in enumerate(zip(got, wanted)):
             pinf_x = np.isinf(x) & (x > 0)
@@ -220,7 +221,7 @@
                     c = "  ".join(map(fmt, wanted))
                     d = fmt(rdiff)
                     msg.append("%s => %s != %s  (rdiff %s)" % (a, b, c, d))
-                assert False, "\n".join(msg)
+                assert_(False, "\n".join(msg))
 
     def __repr__(self):
         """Pretty-printing, esp. for Nose output"""



More information about the Scipy-svn mailing list