Repository navigation
force legacy numpy repr for doctests - #344
Conversation
|
On second thought, we probably don't want to do it this way as this will cause |
d804ac4 to
28bb38c
Compare
|
Rebased to only make the |
This approach is copied from nilearn/nilearn#1592
|
The current approach seems to now be working (OS X still pending on Travis), and should not be globally changing the user's print options. I used an approach borrowed from |
|
This still messes with global state of tests of other packages, e.g. |
|
Hmm, I see the old test output, wasn't enough indeed. |
|
The alternative is to isolate the doctests and run them only on the latest numpy version. That's in general a better approach, exactly because of the kinds of failures we get now. The only purpose of doctests are to check that the examples are not broken (not code coverage), so testing on 1 test run is enough. We can merge this now though to get things unbroken, and fix it up later before the next release. |
| from pywt.version import version as __version__ | ||
|
|
||
| import numpy as np | ||
| if LooseVersion(np.__version__) >= LooseVersion("1.14"): |
There was a problem hiding this comment.
LooseVersion doesn't work correctly in some cases (and neither does StrictVersion), better to use
np.lib.NumpyVersion(np.__version__) < '1.14.0'
| """Returns whether we are running the nose test loader | ||
| """ | ||
| if 'nose' not in sys.modules: | ||
| return |
That sounds good. I will open a separate PR to try that approach instead. |
|
I made the requested changes here. I was hoping the alternative approach in #345 would work, but so far no luck. |
|
Finally all green here. |
84d6e4c to
b6dc67f
Compare
Codecov Report
@@ Coverage Diff @@
## master #344 +/- ##
=========================================
- Coverage 83.72% 83.6% -0.12%
=========================================
Files 21 21
Lines 3300 3325 +25
Branches 558 564 +6
=========================================
+ Hits 2763 2780 +17
- Misses 477 482 +5
- Partials 60 63 +3
Continue to review full report at Codecov.
|
|
The comments were addressed so I am going to go ahead and merge this so that CI is in a working state again. Feel free to open an new issue or PR if there is anything remaining to address. |
|
Thanks @grlee77 |
Many doctests rely on the numpy <=1.13 format array printing. This PR forces this older representation to be used in the docstring examples when numpy >= 1.14.
In the future, once the minimum numpy version supported has been bumped to >=1.14, the doctests should be regenerated with the new representation and these lines can be removed.