[SciPy-Dev] ERROR: Failure: SyntaxError (invalid syntax (test_distributions.py, line 391)

josef.pktd at gmail.com josef.pktd at gmail.com
Tue Jun 8 15:38:59 EDT 2010


On Tue, Jun 8, 2010 at 4:55 AM, Nils Wagner
<nwagner at iam.uni-stuttgart.de> wrote:
> Hi all,
>
> I am using
>
>>>> numpy.__version__
> '2.0.0.dev8460'
>>>> import scipy
>>>> scipy.__version__
> '0.9.0.dev6493'
>
> and I found some (new) errors
>
> ======================================================================
> ERROR:
> test_continuous_basic.test_cont_basic(<scipy.stats.distributions.wald_gen
> object at 0x4cb5c90>, (), 'wald')
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/case.py",
> line 183, in runTest
>     self.test(*self.arg)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/stats/tests/test_continuous_basic.py",
> line 291, in check_cdf_ppf
>     npt.assert_almost_equal(distfn.cdf(distfn.ppf([0.001,0.5,0.999],
> *arg), *arg),
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/stats/distributions.py",
> line 1324, in ppf
>     place(output,cond,self._ppf(*goodargs)*scale + loc)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/stats/distributions.py",
> line 1028, in _ppf
>     return self.vecfunc(q,*args)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/numpy/lib/function_base.py",
> line 1794, in __call__
>     theout = self.thefunc(*newargs)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/stats/distributions.py",
> line 974, in _ppf_single_call
>     return optimize.brentq(self._ppf_to_solve, self.xa,
> self.xb, args=(q,)+args, xtol=self.xtol)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/optimize/zeros.py",
> line 262, in brentq
>     r =
> _zeros._brentq(f,a,b,xtol,maxiter,args,full_output,disp)
> ValueError: f(a) and f(b) must have different signs


looking at changeset 6472, it looks like there are two possible errors
using logcdf instead of cdf
and switching to the internal method (underline) which might not do
correct bounds handling (but I'm not sure about the latter)

4289	 	        return invnorm.cdf(x,1,0)
 	4291	        return invnorm._logcdf(x, 1.0)

reverting this line, I guess, fixes it



>
> ======================================================================
> ERROR: Failure: SyntaxError (invalid syntax
> (test_distributions.py, line 391))
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/loader.py",
> line 379, in loadTestsFromName
>     addr.filename, addr.module)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/importer.py",
> line 39, in importFromPath
>     return self.importFromDir(dir_path, fqname)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/importer.py",
> line 86, in importFromDir
>     mod = load_module(part_fqname, fh, filename, desc)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/stats/tests/test_distributions.py",
> line 391
>     res = distfunc.rvs(*args, size=200)
>                                  ^
> SyntaxError: invalid syntax


I think here the arguments need to be reversed

res = distfunc.rvs(size=200, *args)


Josef


>
> ======================================================================
> ERROR: test_mpmath.test_expi_complex
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/case.py",
> line 183, in runTest
>     self.test(*self.arg)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/numpy/testing/decorators.py",
> line 146, in skipper_func
>     return f(*args, **kwargs)
>   File
> "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/special/tests/test_mpmath.py",
> line 46, in test_expi_complex
>     dataset = np.array(dataset, dtype=np.complex_)
> TypeError: a float is required
>
> Nils
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>



More information about the SciPy-Dev mailing list