[SciPy-User] Fwd: KDTree IndexError

Oleksandr Huziy guziy.sasha@gmail....
Sat Jul 21 15:34:32 CDT 2012


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 object

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.

Cheers
--
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>wrote:
>
>> Hi,
>>
>> 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
>>
>> sys.setrecursionlimit(10000)
>>
>> your bad data script works OK. Probably it would work with less...
>>
>>
> Should we put that in the Notes section of the KDTree docstring?
>
> Ralf
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120721/8342924e/attachment.html 


More information about the SciPy-User mailing list