-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Fixes #1795 sphzone selection regression #1818
Conversation
Looks like the new test fails in Python 2.7 but not 3.6; will have to investigate. |
This is related to zip() but actually isn't repaired by using the six.moves.zip. I basically need a way to feed in parametrized arguments from subclassed test objects -- wasn't working when I tried to to do this early -- maybe I'll have another go tonight. Basically, there are two test classes that inherit from This basically means that 549 @pytest.mark.parametrize('input_val, expected',
550 list(zip(methods,
551 sphzone_expected)))
552 def test_spherical_zone(self, u, input_val, expected): Should have different values of |
@tylerjereddy I don't think that's easily fixed. You could just redefine the test in each subclass |
…ly handle regression in Issue #1795.
@@ -602,12 +588,38 @@ def test_cyzone(self, u, meth, periodic): | |||
|
|||
assert ref == set(result.indices) | |||
|
|||
@pytest.mark.parametrize('input_val, expected', | |||
zip(BaseDistanceSelection.methods, | |||
[25, 31, 33, 25])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this means that kdtree and non-kdtree are returning a different result for periodic=True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that mean more changes are needed or we need to think about this a bit more?
Ok, I've redefined the pertinent test in each subclass with appropriate expected values. Locally, the tests now pass in Python 2.7 & 3.6 -- we'll see what the CI says. The code duplication is perhaps a little ugly, but prettier solutions were proving problematic (and time consuming). A fixture or something probably could be used for concision. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking into this myself, I think this fix is fine, but I want to double check it
@tylerjereddy I think you will have to look at the merge. This might also kick appveyor to actually run the tests. |
@orbeckst Noted / put reminder on my calendar to take a look soon-ish |
The test file has been refactored pretty substantially, I think there have been a lot distance-based operation changes lately -- has the linked issue been confirmed on latest develop branch? I'll have to check that next I guess. |
#1795 is now fixed |
Fixes #1795
Supersedes attempted fix in #1806 based on feedback from @richardjgowers. The corresponding unit test now only crudely checks for regression of
sphzone
behavior as it relates to the reported issue, rather than making any claims about the geometric correctness of the selection.I verified that the script I used for git bisecting the regression is happy with this fix & that the regression test (modified from the original unit test) does fail alongside the bisection script without the application of the fix used in this PR.
We'll see what the CI says. More detailed & correct handling of pbc & wrapping issues are delayed to future efforts, as discussed in the linked issue / PR above.