[SciPy-User] Fwd: KDTree IndexError

DParker@chromallo... DParker@chromallo...
Mon Jul 23 14:26:44 CDT 2012

Increasing the recursion limit to 10000 worked for all of the data I am 
currently working with. 

I agree that it would be helpful to note the possibility of this error in 
the documentation. 

David G. Parker

From:   Oleksandr Huziy <guziy.sasha@gmail.com>
To:     SciPy Users List <scipy-user@scipy.org>
Date:   07/21/2012 04:34 PM
Subject:        Re: [SciPy-User] Fwd: KDTree IndexError
Sent by:        scipy-user-bounces@scipy.org

Hi I've tested this solution on iMac (python2.6) and Ubuntu (python2.7), 
and it worked.

On Ubuntu I got the following message for the initial script:

RuntimeError: maximum recursion depth exceeded while calling a Python 

which has lead me to the solution. It would be helpful to have the warning 
in the docstring just for the cases when the RuntimeError is not raised. 
Maybe just wait the DParker's confirmation that the solution works for all 
of his data.

I also tried changing the leafsize parameter but that did not seem to have 
any effect.

Oleksandr Huziy

2012/7/21 Ralf Gommers <ralf.gommers@googlemail.com>

On Sat, Jul 21, 2012 at 12:19 AM, Oleksandr Huziy <guziy.sasha@gmail.com> 

the kdtree implementation uses recursion, and the standard limit of the 
recursion depth in python is 1000.

For some of your data you need more than 1000 (for the bad data).

When I put 

import sys

your bad data script works OK. Probably it would work with less...

Should we put that in the Notes section of the KDTree docstring?


SciPy-User mailing list

SciPy-User mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120723/76a663da/attachment.html 

More information about the SciPy-User mailing list