-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Reference manual: class hierarchy, inherited members, underscore variables #7549
Comments
Attachment: trac_7549-doc_inheritance_underscore.patch.gz Doc build options for inherited members, private variables. Inheritance diagrams. Apply to sage repo. |
comment:1
The patch, which may depend weakly on #7473's "builder" patch,
It's likely that the attached patch needs work. In particular, Note: To force a rebuild when toggling
Toggling |
comment:4
Putting
at the beginning of Should we do this with every Sage library .py and .pyx file? |
comment:5
After adding the "utf-8" line to lyndon_word.py, I got this error:
After fixing this (by ripping out a doctest), things built fine. The html version of the reference manual looks good, and seems to have all of the methods we want, with the inherited ones having no docstrings. Here are some timings on my iMac. Between each build, I removed the directory doc/output:
Also
took too long on my iMac. On sage.math, it took about 2 hours and then bombed when trying to run pdflatex: there was one error (a missing "r" before a triple-quoted docstring with backslashes); once this was fixed, it ran for a while and then said
I don't know if there is a way of fixing this, short of #6495. (I think that the tex installation on sage.math is somewhat old, which doesn't help.) |
comment:6
I have yet to succeed making a pdf version of the reference manual. On the two machines I've tried, it takes ages and then crashes with "TeX capacity exceeded". This happened just with the "-i" option on my iMac. I haven't tried all of the possibilities on all of the machines. So I wonder if it makes sense, at least until something like #6495 is in place, to disable the "-i" and "-u" flags for the pdf version of the manual. If not disable them, then at least print a warning saying it's going to take a long time and then might very well crash? |
comment:7
Sure, I have no problem with either course. We could also make Aside: I can't even build the HTML manual with |
comment:8
Maybe we can use Sphinx's intersphinx extension to implement a HTML analogue of #6495? |
comment:9
For links to Sage tickets, we could use Sphinx's extlinks extension. |
comment:10
Did you try to launch lex with more memory ? I remember doing a
in a similar situation. |
Set up intersphinx for Python docs. Replaces previous patch. sage repo. |
Author: Mitesh Patel |
comment:11
Attachment: trac_7549-doc_inheritance_underscore_v2.patch.gz Version 2, which replaces the previous patch,
|
comment:12
It seems that |
comment:13
Please see #6495 for progress on incrementally building the reference manual. |
Rebased for 4.3.alpha1. Replaces previous patches. |
comment:14
Attachment: trac_7549-doc_inheritance_underscore_v3.patch.gz I should add that we can also link directly to matplotlib's docs from the Sage documentation. We just need to update |
comment:15
Against 4.3.2.alpha1:
|
comment:16
Replying to @qed777:
Cython, mpmath, and Sphinx are possibilities. Building Sage shouldn't rely on an internet connection, though, and it seems to me that intersphinx does. So should we also include the object inventories so that we can build the docs without an internet connection? This would rely on keeping those up to date. Can we have it check for an internet connection and fail gracefully if there isn't one? Right now I don't know what I'm doing wrong, but I can't get private methods to be included in the docs. This is with 4.3.2. I put in a print statement in |
Rebased vs. 4.3.3.alpha0. See comment. Apply only this patch. sage repo. |
comment:17
Attachment: trac_7549-doc_inheritance_underscore_v4.patch.gz V4
Should we move the new options to the "Advanced" section? Add "may use lots of memory"? Note: I still haven't done a complete build in each configuration. |
comment:18
I should add that I've disabled the intersphinx extension, for now. It can cache inventories, but I don't know whether it fails gracefully if the cache has "expired" but there's no connection. |
comment:19
The HTML manual builds with Building the PDF manual with
after I suppress problems with underscored methods in
I'll fix the first problem in a separate ticket and leave the others for someone else. |
comment:20
I get the html manual to build, too, although with 1517 warnings when built with "-u", and more than 28,000 warnings with "-iu": either because the docstrings for underscore methods are sloppily formatted (not a surprise) or messages along the lines of those in #8244. I noticed that after I built with "-j -iu", edited a few files and ran "sage -b", then when I built the manual again with "-j -iu", in the "reading sources" portion of the build, it only processes the changed files, but in the "writing output" phase, it rewrites all of the files. This could be a little annoying; can it be avoided? I haven't had the time to try a pdf build yet, but I'll work on that later today. |
comment:21
Now I've tried building the pdf, and I run into the same "TeX capacity exceeded" message. I've tried altering "extra_mem_top" and "extra_mem_bot", but it's not helping. (I may not be doing this right, though.) I had to fix more problems to get the PDF to build: everywhere there was an email address, pdflatex was crashing on the @ sign, so I had to enclose the address in double backquotes. So I ended up changing these files (in addition to sagenb.notebook.worksheet: I applied the patch from #8265 to deal with this one):
I don't think that fixing these is a high priority, since the PDF manual doesn't build anyway with the "-u" option. Aside from my question about why "-iu" rewrites all of the output when it shouldn't have to, I'm happy with this. (I haven't tested this with "-i" or "-u".) I agree that there should be a comment about "-i" and "-u" taking a lot of memory, and perhaps saying that they don't work with the pdf build. I don't think they need to be in the "advanced" options. |
comment:25
Replying to @qed777:
I'm not sure, but I just saw this message at the beginning of a docbuild:
|
comment:26
I've seen this message, too. It might be a Sphinx bug. The HTML builder writes a hash of the If, for some reason, this But I don't know if this is responsible for what we see. |
Attachment: trac_7549-doc_inheritance_underscore_v5.patch.gz Rebase vs. 4.3.4.alpha1 + #8457. Apply only this patch. |
comment:27
V5 is rebased for 4.3.4.alpha1 + #8457. I'm not sure what we should do about the many |
comment:28
If I run
I scanned the traceback but didn't see anything obviously helpful. By the way, I think we can put back the doctest from interfaces/singular.py, by changing the triple quotes at the beginning of the docstring to Also, I used all of the extra error messages to figure out where the warnings
were coming from, and the attached patch fixes the problems. So now, combined with #8457, I get no error messages when building the reference manual (without the -i or -u switches, of course). For the new warnings when building with -i or -u or -iu, I say we deal with them on another ticket. It's a big job revising all of the docstrings for underscore functions so that they are in proper reST format. (Also, right now they're useful -- see the previous paragraph. :) Finally, do we want some sort of warning for the -i switch, and possibly the -u switch? ("may be slow, may not be compatible with PDF output" as part of its help string, for example)? |
comment:29
(You may need to apply #8511 to get rid of one of the "unexpected indentation" warnings.) |
comment:30
On second thought, I moved the "unexpected indentation" fix to ticket #8511, so the "small fixes" patch just reinstates the interfaces/singular.py doctest. |
apply on top of other patch |
Attachment: trac_7549-small-fixes.patch.gz Attachment: trac_7549-doc_inheritance_underscore_v6.patch.gz Fix recursion problem. Apply only this combined patch. |
Changed author from Mitesh Patel to Mitesh Patel, Florent Hivert |
comment:32
The only change is in |
Attachment: trac_7549-doc_inheritance_underscore_v7.patch.gz Help notes. Replaces V6. |
comment:33
Replying to @qed777:
Hi Mitesh ! I don't see any code from me here except a few lines who where already in #7448, and which you decide to improve (thanks by the way). So I don't think I deserve to be in the author. Also I'm Ok with reviewing this but they are three more tickets in combinatoric which I committed myself to review. So don't rely on me for reviewing this very soon... However, I'd like to see this merged soon, so if you imagine someone who is willing to review, please ask him. Anyway, thanks for this work. I really this sage's doc is going to greatly improve. |
Changed author from Mitesh Patel, Florent Hivert to Mitesh Patel |
comment:34
Sorry for not getting to this sooner. Positive review. |
Reviewer: John Palmieri |
comment:36
Merged in 4.4.alpha0:
|
Merged: sage-4.4.alpha0 |
In the Sage reference manual, it might be useful to
__init__
,_foo
).Sphinx extensions of interest: autodoc, inheritance_diagram.
See sage-devel for some discussions.
CC: @hivert @jhpalmieri @nthiery @sagetrac-mvngu @jasongrout
Component: documentation
Author: Mitesh Patel
Reviewer: John Palmieri
Merged: sage-4.4.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/7549
The text was updated successfully, but these errors were encountered: