Temporarily disable nsgrid (Issue #2930)#3004
Conversation
|
Hello @IAlibay! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2020-12-22 13:01:12 UTC |
package/MDAnalysis/lib/nsgrid.pyx
Outdated
|
|
||
| .. versionadded:: 0.19.0 | ||
|
|
||
| Important Note |
There was a problem hiding this comment.
I have only left a note, would a warning be useful too? (not really sure how you do warnings in a cython file).
There was a problem hiding this comment.
Do you mean import warnings? I think that should work.
Can you also add a warning in the markup
.. warning::
The current nsgrid code can return incorrect values. Do not use for production use.
See issue `#2930<https://github.com/MDAnalysis/mdanalysis/issues/2930>`_ for further context.(I hope that's the right syntax for inline reST links).
Codecov Report
@@ Coverage Diff @@
## master #3004 +/- ##
==========================================
+ Coverage 91.36% 92.00% +0.64%
==========================================
Files 161 166 +5
Lines 22224 22734 +510
Branches 3194 3194
==========================================
+ Hits 20304 20916 +612
- Misses 1290 1726 +436
+ Partials 630 92 -538
Continue to review full report at Codecov.
|
orbeckst
left a comment
There was a problem hiding this comment.
Thanks @IAlibay ! Looking good to me; I don't know if there are any more places where it might show up, though.
I assume the actual tests for the code are still in place?
I have minor comments/suggestions for docs – please see inline.
package/MDAnalysis/lib/nsgrid.pyx
Outdated
|
|
||
| .. versionadded:: 0.19.0 | ||
|
|
||
| Important Note |
There was a problem hiding this comment.
Do you mean import warnings? I think that should work.
Can you also add a warning in the markup
.. warning::
The current nsgrid code can return incorrect values. Do not use for production use.
See issue `#2930<https://github.com/MDAnalysis/mdanalysis/issues/2930>`_ for further context.(I hope that's the right syntax for inline reST links).
So I can't seem to find any more cases of FastNS being imported (just doing a recursive grep for files in Outside of
So the tests that have been affected here are those that invoke capped_distance or self_capped_distance, so it lowers coverage of nsgrid a little bit, but test_nsgrid is still there. |
|
@IAlibay please merge at your leisure (unless anyone else finds something, of course) |
Will do, just adding those warnings and this should be good :) |
|
Apart from my own stupidity (see #3011 ...) this is the last real thing to be completed for 1.0.1 to ship. |
|
Ok, changed the docs to have proper pinging @MDAnalysis/coredevs can someone give this a quick re-review so we can merge with the aim of prepping the 1.0.1 release tomorrow (@richardjgowers nicely suggested walking those interested to learn through it). |
|
The tests fail because the fastns warning is not always raised. Perhaps we have to ensure that it is always raised and never muted? |
I honestly have no idea why this isn't working. It works fine if I build locally on my end 😕 The fact that azure builds and the other CIs don't probably mean there's an option we are/aren't turning on somewhere that disables this warning but I can't seem to work out what. |
|
If we make it something that's not a Alternatively, can you enforce raising warnings in your test? Some of the text in https://docs.python.org/3.8/library/warnings.html#testing-warnings and above says that any of the fancy temporarily changing warning behavior is not well defined in multi-threaded applications. I think parallel pytest uses different processes so that should be ok. There's also a note
which suggests that we might have to globally set our warnings filter at the beginning of the tests to ensure that we always see our warnings. |
|
Now this is quite suspicious, The fact that only the nsgrid test for the Is it possible that somehow CI isn't recompiling the cython files? Pinging @richardjgowers and @tylerjereddy who might know better about the peculiarity of our Travis setup & cython compiling. |
|
Following https://docs.python.org/3/library/warnings.html#overriding-the-default-filter, perhaps we should add an "always" at the start of our tests in import sys
if not sys.warnoptions:
import os, warnings
warnings.simplefilter("always") # Change the filter in this process
os.environ["PYTHONWARNINGS"] = "always" # Also affect subprocesses(I would have assumed that This should ensure that warnings are never counted as "have already occurred" and hopefully get around the problem
One thing to check would be if
|
|
@orbeckst the problem here isn't that the warning isn't being emitted, it's that the new cython code isn't being compiled to c to begin with. Looking at differences between azure (which works) and the other two CI methods, I suspect the problem is how we call setup.py. @richardjgowers' suggestion here was to try just check the new c files in, however I'd prefer fix CI to begin with (if possible). |
|
If we are not rebuilding the C files then what are we are actually testing??
|
|
The Travis output only contains Line 31 in 2ef90f2 with to have the same across our CI providers? (I have no idea why we used a developer install there anyway...) |
|
Apologies, I've not had time to really spend on this. I'm going to open a separate test PR targeting |
|
Ok, so we know that it works on #3024, so it's |
|
So I've spent a fair amount on this and I'm still baffled that what's in The only option I can think of here is to push the new |
|
Thank you for all the hours you put into trying to figure it out!!! Did you confirm locally that it works as expected? If so, in order to get 1.0.1 out I suggest you make the corresponding text XFAIL or XPASS (?) in 1.0.1, add a comment describing the problem and reference the discussion here. Let's move forward. |
|
So finally yielding on fixing CI and following @richardjgowers' wisdom does the trick here. It seems like we'll have to push re-generated Maybe the option is to create a separate I've reverted all the CI yml changes for now since they had no impact. @orbeckst does this work for you? If so we can merge & look to ship 1.0.1 soon. |
|
Sorry, behind on things.... Let's move forward with the way you suggest. Using master for 1.x is dirty anyway, better be explicit. 🚀 |
|
Might the failure to recreate .c/pp files change now with GH actions? |
|
Ok, this should be good to merge? |
|
The sooner the better! 🚢 |
There was a problem hiding this comment.
LGTM, thank you @IAlibay for pushing this through! 💫
Fixes #2930
Changes made in this Pull Request:
PR Checklist