Repository navigation
Add selftest for Bio.PDB.NeighborSearch - #1366
souravsingh wants to merge 10 commits into
Conversation
| @@ -0,0 +1,26 @@ | |||
| # Copyright 2017 by Peter Cock. All rights reserved. | |||
There was a problem hiding this comment.
This isn't my work.
The original test was written by Thomas Hamelryck (CVS username nisse) in Dec 2002, see https://github.com/souravsingh/biopython/commit/b9996bf27c6c69e22ce1c78a18f5285ebf8b3fe0
I would suggest:
# Copyright 2017 by Peter Cock. All rights reserved.
# Based on code Copyright 2002 by Thomas Hamelryck. All rights reserved.
There was a problem hiding this comment.
Sorry, my mistake - I copy-pasted this but meant to put your name here.
Also I think it would be reasonable to dual license this file, so:
# Copyright 2017 by Sourav Singh. All rights reserved.
# Based on code Copyright 2002 by Thomas Hamelryck. All rights reserved.
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
| al = [Atom() for j in range(100)] | ||
| ns = NeighborSearch(al) | ||
| for i in range(0, 6): | ||
| for i in [0, 1, 2, 3, 4, 5, 6]: |
There was a problem hiding this comment.
Why not use range(7) which gives 0, 1, 2, 3, 4, 5 ,6?
|
The tests are all failing on TravisCI (AppVeyor timed out during a download), eg |
|
@peterjc The original self-test gives the following output- I believe the |
|
Perhaps something like this then if we expect between 1 and 5 hits?: self.assertTrue(1 <= len(ns.search_all(5.0)) <= 5) |
|
@peterjc The tests are failing for Windows due to the |
|
Well spotted. There are two issues here, first this test should be skipped if That is done using the following snippet of code in try:
from Bio.KDTree import _CKDTree
del _CKDTree
except ImportError:
from Bio import MissingExternalDependencyError
raise MissingExternalDependencyError(
"C module in Bio.KDTree not compiled")Second, this points at something wrong in the AppVeyor configuration which I had not noticed until you spotted it.... logged as #1378. Thank you! |
|
There is a test written for biopython/Tests/test_PDB_KDTree.py Line 32 in 589bc07 |
|
Well spotted. OK, for this pull request you can just remove the self-test from However, based on Eric's comments it would be great to open another pull request to improve that test in |
|
Closing the PR in favor of a new PR |
|
Did you work on a new branch? I don't see another pull request... |
This pull request addresses issue #820
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I am happy to be thanked by name in the
NEWS.rstandCONTRIB.rstfiles.I have read the
CONTRIBUTING.rstfile and understand that AppVeyor andTravisCI will be used to confirm the Biopython unit tests and
flake8stylechecks pass with these changes.