-
Notifications
You must be signed in to change notification settings - Fork 262
DOCTEST: Use legacy float array printing for now #556
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #556 +/- ##
==========================================
- Coverage 94.34% 94.33% -0.01%
==========================================
Files 177 177
Lines 24670 24680 +10
Branches 2634 2635 +1
==========================================
+ Hits 23275 23283 +8
- Misses 920 921 +1
- Partials 475 476 +1
Continue to review full report at Codecov.
|
@matthew-brett I think you'll know more about how to deal with this error than I do. Is this an issue on matplotlib's end, or some buildbot that needs fixing?
|
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.
Some hopeful suggestions.
nibabel/nifti1.py
Outdated
@@ -9,6 +9,12 @@ | |||
''' Read / write access to NIfTI1 image format | |||
|
|||
NIfTI1 format defined at http://nifti.nimh.nih.gov/nifti-1/ | |||
|
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.
Can we make this two separate strings, so the user doesn't get this testsetup in the docstring help?
nibabel/nicom/dwiparams.py
Outdated
@@ -18,6 +18,11 @@ | |||
|
|||
B ~ (q_est . q_est.T) / norm(q_est) | |||
|
|||
.. testsetup:: |
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.
Can we put this in a separate docstring? See comment below.
nibabel/quaternions.py
Outdated
@@ -23,6 +23,12 @@ | |||
>>> M = quat2mat(q) # from this module | |||
>>> vec = np.array([1, 2, 3]).reshape((3,1)) # column vector | |||
>>> tvec = np.dot(M, vec) | |||
|
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.
Ditto.
Hopefully this works. I don't know all the rules to doctests. |
b803ac6
to
dab6331
Compare
Is there some way to do a package-wide pre-doctest setup so we can have this in one place? Hard to google. |
I don't know how to set up project wide doctest initialization - other than writing a specific nibabel plugin for the doctests / nose. |
dab6331
to
600f7f2
Compare
I think I've resolved this. If there's a |
b72634f
to
26dfee3
Compare
b27efce
to
70afacb
Compare
@matthew-brett Does this look reasonable? |
Thanks - looks good - in it goes. |
In numpy's pre-release, float arrays now have different printing strategies. Adding
#doctest: +NORMALIZE_WHITESPACE
doesn't resolve the issue, so for the moment we need to use their option to revert printing behavior to keep doctests from breaking.Using
.. testsetup::
should avoid visual changes to the docs.Introduced in numpy/numpy@710e032