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
Fix doctests and let TravisCI run doctests #811
Conversation
Thanks for cleaning all this up! Could you additionally build the html docs on travis-ci? |
I am not able to get it working. I cannot find a way to ignore the skimage.viewer test cases with Does anybody have an idea to fix this? |
@ahojnnes, does the skipif decorator not help here? I can't find the failed line in Travis so I don't know what else to look for... |
The problem are not the normal tests but to the nosetests to skip the doctests in skimage.viewer. The failed line is the last line of all tests at the moment (because it "cannot connect to X server"). |
Can you use |
I have a local Ubuntu virtual box where I'm trying to get it to work. |
Regarding the runtime of the whole travis process: Before Py2 ~16min, Py3 ~21min |
""" | ||
|
||
# window extent in one direction | ||
wext = (window_size - 1) / 2 | ||
wext = int((window_size - 1) / 2) |
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.
Should this be (window_size - 1) // 2
?
This is great, thanks @ahojnnes . Can I go ahead and merge? |
Nothing holding this back from merging from my side. |
Fix doctests and let TravisCI run doctests
Good stuff. These doctest fixes should also be part of the next bugfix release? |
Yes, I would include them in the next bugfix release. Before we push it, we should maybe let Christoph Deil and others run the tests quickly to confirm everything works correctly? |
Works for me on Mac, except for these two doctest fails on Python 3.3: Do you need to click the "Restart build" button on travis-ci for open pull requests to benefit from this improved testing or did that happen automatically? |
@cdeil, which version of Qt do you have? |
I think the problem is that I didn't have PyQT or PySide installed for Python 3.3. So I guess what is missing in that doctest is some marker to skip it if Qt is not available instead of reporting a test error, because it's an optional |
I have no idea how to do that in a doctest. @ahojnnes? |
I think there is no direct way to achieve this inside the doc tests. But you could ignore the viewer module if skimage.viewer.qt.qt_api is None? |
This PR from NiPy might be of interest - it includes a skip decorator for a given condition. |
I don't have time I look into it but from a quick glimpse it seems to solve the problem. +1 for integrating this if anybody ha enough time for this. |
Looks good to me. |
Addition incoming. The DiPy framework needed to be tweaked a bit for it to work as a decorator for both function and class docstrings, as classes don't expose a |
I see a new DiPy contributor in the works...double PR! |
* Adding first draft of Cython relabel_sequential Co-authored-by: Juan Nunez-Iglesias <juan.nunez-iglesias@monash.edu> * fixed order of args for map_array * Add ArrayMap str and repr * Add __call__ method to ArrayMap object * Add missing colon * Add array representation for ArrayMap * Use array representation to preserve relabel_sequential doctests * Restore ValueError checks for relabel_sequential * Fix PEP8 issues * Ensure 0 always maps to 0 * Ensure dtype is correct for output * Fix incorrect dtype for array being relabeled The docs specify that only integer arrays are supported. This change was added in gh-811 without any discussion so imho safe to revert. * Fix dtype of output and map * Inverse map dtype should actually map the input dtype * Fix docstring for map_array, check for contiguous out * Add docstring for ArrayMap * Rename attributes in ArrayMap * Add C++0x standard to the compiler options * added missing paren in docstring * mention large size of returned array in __array__ docstr * adjusted sample array to fix doctest Co-authored-by: Juan Nunez-Iglesias <juan.nunez-iglesias@monash.edu> * added tests for dtype overflow * test relabel_seq... works for large input * Simplify checking of contiguous array Co-Authored-By: Riadh Fezzani <rfezzani@gmail.com> * Minor code updates from review Co-Authored-By: Riadh Fezzani <rfezzani@gmail.com> * Restore reshaping of output array when provided * Add note about -std=c++0x flag * Ensure reshape is zero-copy * Clarify error message when output has incorrect shape * Remove unused numpy import * Update relabel_sequential docstring to indicate new output types * Raise error if the input array has non-integer type * Ensure arrays being mapped and value arrays have same dtype * Add doctests for ArrayMap.__str__ and fix * Rework logic for in-place reshaping * Add test for error when labels dtype is not int * Add test for incorrect map_array output shape * Test discontiguous output array * Add test for long reprs for ArrayMap * Add test for calling ArrayMap * Remove long-deprecated relabel_from_one * Add len to ArrayMap * Add support for setitem and scalar mapping * Add support for slicing and updating map in-place * Allow bool indices in arraymap getitem Co-authored-by: Volker Hilsenstein <volker.hilsenstein@monash.edu> Co-authored-by: Juan Nunez-Iglesias <juan.nunez-iglesias@monash.edu> Co-authored-by: Riadh Fezzani <rfezzani@gmail.com>
No description provided.