[SciPy-Dev] Enhancements to scipy.spatial.cKDTree

Ralf Gommers ralf.gommers at googlemail.com
Sat Jul 14 17:03:54 EDT 2012


On Sat, Jul 14, 2012 at 8:03 PM, Sturla Molden <sturla at molden.no> wrote:

>  Raph, do you mind testing again on your Mac?
>

On my system all tests pass now.


> (I am suspecting another integer problem related to Windows 64...)
>
> Sturla
>
>
>
>
> Den 14.07.2012 19:36, skrev Sturla Molden:
>
> I have traced down the bug, it was related to an array being altered
> inplace instead of copied.
>
> I have also taken out two other bugs related to C long (and Python int)
> being 32 bit on Windows 64.
>
> I still get four fails on Win 64. They are there in Patrick's code as
> well, so they are related to his coding.
>
> An update is commited here:
>
> https://github.com/sturlamolden/scipy/blob/master/scipy/spatial/ckdtree.pyx
>
> Taken over in https://github.com/rgommers/scipy/tree/fixes-sturla

I know you may not have the time or interest to learn about git right now,
but it may make both our lives easier if you try the below steps. It will
allow you to put your commits on top of mine without any manual copying.

$ git remote add rgommers https://github.com/rgommers/scipy
$ git fetch rgommers
$ git checkout -b fixes-sturla rgommers/fixes-sturla

Now your local copy of the code is up to date and in sync with mine; you
can now make commits in this branch, preferably with a commit message that
is somewhat more descriptive than "update master".

Then to push them to github:
$ git push origin fixes-sturla

Cheers,
Ralf



> Sturla
>
>
>
> D:\kd-tree\20120714-cKDTree>python test.py
>
> ..............................................................................................................................FFFF...
> ======================================================================
> FAIL: test.test_onetree_query_compiled(<ckdtree.cKDTree object at
> 0x000000000583AE18>, 0.1)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
>     self.test(*self.arg)
>   File "D:\kd-tree\20120714-cKDTree\test.py", line 570, in
> check_onetree_query
>     assert_(s == T.query_pairs(d))
>   File "C:\Python27\lib\site-packages\numpy\testing\utils.py", line 34, in
> assert_
>     raise AssertionError(msg)
> AssertionError
>
> ======================================================================
> FAIL: test.test_onetree_query_compiled(<ckdtree.cKDTree object at
> 0x000000000583AE18>, 0.001)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
>     self.test(*self.arg)
>   File "D:\kd-tree\20120714-cKDTree\test.py", line 570, in
> check_onetree_query
>     assert_(s == T.query_pairs(d))
>   File "C:\Python27\lib\site-packages\numpy\testing\utils.py", line 34, in
> assert_
>     raise AssertionError(msg)
> AssertionError
>
> ======================================================================
> FAIL: test.test_onetree_query_compiled(<ckdtree.cKDTree object at
> 0x000000000583AE18>, 1e-05)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
>     self.test(*self.arg)
>   File "D:\kd-tree\20120714-cKDTree\test.py", line 570, in
> check_onetree_query
>     assert_(s == T.query_pairs(d))
>   File "C:\Python27\lib\site-packages\numpy\testing\utils.py", line 34, in
> assert_
>     raise AssertionError(msg)
> AssertionError
>
> ======================================================================
> FAIL: test.test_onetree_query_compiled(<ckdtree.cKDTree object at
> 0x000000000583AE18>, 1e-06)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
>     self.test(*self.arg)
>   File "D:\kd-tree\20120714-cKDTree\test.py", line 570, in
> check_onetree_query
>     assert_(s == T.query_pairs(d))
>   File "C:\Python27\lib\site-packages\numpy\testing\utils.py", line 34, in
> assert_
>     raise AssertionError(msg)
> AssertionError
>
> ----------------------------------------------------------------------
> Ran 133 tests in 4.351s
>
> FAILED (failures=4)
>
>
>
> Den 14.07.2012 13:17, skrev Ralf Gommers:
>
>
>  I took your edits and committed them as a diff to Patricks last commit.
> Then I added a few style fixes:
> https://github.com/rgommers/scipy/tree/fixes-sturla. The best way to get
> this in would be for Patrick to add these commits to his branch so they
> show up in his PR (after finding a bug, see below).
>
> I did some testing (python 2.6, 32-bit, OS X 10.6), I get one test failure
> with Sturla's edits. Patrick's branch given me no failures.
>
>  ======================================================================
> FAIL: test_kdtree.test_count_neighbors_compiled.test_multiple_radius
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/nose-1.1.2-py2.6.egg/nose/case.py",
> line 197, in runTest
>     self.test(*self.arg)
>   File "/Users/rgommers/Code/scipy/scipy/spatial/tests/test_kdtree.py",
> line 496, in test_multiple_radius
>     assert_equal(self.T1.count_neighbors(self.T2, r), result)
>   File "/Users/rgommers/Code/numpy/numpy/testing/utils.py", line 313, in
> assert_equal
>     raise AssertionError(msg)
> AssertionError:
> Items are not equal:
>  ACTUAL: 6
>  DESIRED: 54
>
> The actual and desired numbers change due to random numbers without a seed
> being used, but it fails consistently. The missing seed is no real problem
> here, because the code simply does the same twice; it only tests if the "r"
> input to count_neighbors is correctly vectorized.
>
> Ralf
>
>
>
> _______________________________________________
> SciPy-Dev mailing listSciPy-Dev at scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
>
>
> _______________________________________________
> SciPy-Dev mailing listSciPy-Dev at scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20120714/0d1d9d1b/attachment.html>


More information about the SciPy-Dev mailing list