-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
CI: fixing doctests #8279
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
CI: fixing doctests #8279
Conversation
|
Not related to this PR: that numpy prints complex numbers as
`9.90012467+0. j` looks annoying because that's not copypasteable
any more. This maybe is a numpy bug...
|
I agree, it doesn't look nice. The link in my first comment suggests that one can use a legacy print mode. Perhaps that's the way forward for the time being? I'm not sure how one would go about setting that mode, presumably in ref_guide.py? |
|
I think the documention has to agree with whatever Numpy does out of the
box, so we shouldn't try to adjust the printing. The only thing could be
to complain on numpy issue tracker that the new printing of complex
numbers does not look optimal.
|
|
There's something going on with that specific example in tutorial/linalg.rst. The output is different on the travisCI box vs my OSX machine. |
|
There's also an unrelated stats test failing on Appveyor, I don't have access to a windows box but it looks like is an issue. Not sure of the ultimate cause. |
|
see numpy/numpy#10355. @pv, I think you posted on there that we should hold off on this merge until the printing gets fixed. Unfortunately that'll mean that our CI is out of action until the next numpy release. |
|
The ultimate cause is that |
|
W.r.t In
The documentation for
It doesn't say that warnings are raised if NaN's are in the array. On my machine: The code in L3711 to L3714 contains the lines: perhaps this should be: |
Have a look at this weird behaviour I've just seen in my interpreter: i.e. why does the warning only appear once? |
|
@xoviat it appears I edited your comment by mistake, sorry. |
|
The behavior appears to be deterministic on my windows machine; it always gives the warning (the results are the same). Do you think that, conceptually, there should be a warning? |
|
If so, then the test would appear to be broken. |
|
I think the documentation and actual behaviour should tally.
This doesn't indicate that a warning will result. I have just done the following in a clean conda env (3.6.2) with numpy installed via pip. There were no warnings! The weird behaviour in my previous post was that didn't give any warnings, but then when I subsequently typed Something isn't working reproducibly across numpy installs. |
|
LGTM modulo a need for a rebase. Refguide-checker should be able to handle some of these, but that needs someone to have a look. I probably will at some point, no ETA though. |
doc/source/tutorial/fftpack.rst
Outdated
| >>> y = fft(x) | ||
| >>> y | ||
| array([ 4.50000000+0.j , 2.08155948-1.65109876j, | ||
| array([ 4.5 +0. j, 2.08155948-1.65109876j, |
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.
The complex printing format will apparently change again in numpy 1.14.1, so we may want to postpone proceeding once that's been fixed...
|
Numpy 1.14.1 is out, so I think we could resume this discussion.
|
|
Rebased the PR, so we'll see what happens. AFAICT the doctesting is being done on py35, with pypi numpy? Whilst looking at the travis config am I right in understanding that we test the numpy master branch in a py27 environment? We should probably move that to 3.x. |
|
We obviously wouldn't have picked the numpy issues up with the doctesting unless we were targeting the master branch, rather than the released wheel. |
|
A few minor nits needed changing. |
|
While the default doctest behavior is very picky about whitespace, our test checker tries to select numeric entities and I'd suggest to both fix the nits so that our examples match what numpy outputs out of the box, and improve the doctester (in a separate PR). |
|
So if the changes I've made here finally work, then this should be mergeable. Currently PR's will have at least one fail because of the doctest errors fixed in this PR. |
|
Thanks @andyfaff; will be nice to have the CIs green again. |
TST: doctest changes for NumPy 1.14.1
Travis is currently failing because doctests have some formatting issues due to numpy 1.14.
From a ML conversation minor errors should be being picked up by the refguide checker, but it's not currently doing that.
This PR simply corrects the doctest output.