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
Docbuild warnings in sage/interfaces/matlab.py #9608
Comments
Attachment: trac_9608-matlab_docbuild.patch.gz Make the docstring raw |
Author: Mitesh Patel |
comment:2
A one-character patch! Nice. It does get rid of the warning for me, but I'd like to understand why the docstring needs to be raw. How does that fix the unindent warning? |
comment:3
I think the problem with the original docstring is that the backslashes are not escaped, so perhaps Sphinx interprets the """
Returns the string s with Matlab's answer prompt removed.
EXAMPLES::
sage: s = '
ans =
2
'
sage: matlab.strip_answer(s)
' 2'
""" Not using a raw string but replacing the |
comment:4
Replying to @qed777:
Hrm, doing that doesn't fix the problem -- the function then gets a string with no newlines, but with literal "\n" bits. I'm almost certain that making the docstring raw is the right thing to do, but I'd like to have someone who knows more about doctesting and Sphinx look at this. |
comment:6
Isn't that what you want? You're defining s to be a particular string, one containing "\n" in it (to give a newline), and you want each "\n" to appear as such in the reference manual. That is, This makes sense to me, and I've seen other docstring errors and fixes just like this in the past. The particular docstring here looks much better after the patch, and there are no warnings. Positive review. |
Reviewer: John Palmieri |
Merged: sage-4.5.2.rc0 |
Docbuild warnings in Sage 4.5.2.alpha1:
Possibly related ticket: #2119.
CC: @dandrake @mwhansen @sagetrac-rossk @nexttime
Component: documentation
Author: Mitesh Patel
Reviewer: John Palmieri
Merged: sage-4.5.2.rc0
Issue created by migration from https://trac.sagemath.org/ticket/9608
The text was updated successfully, but these errors were encountered: