Hi John, On Sun, Apr 18, 2010 at 1:04 AM, John H Palmieri <jhpalmier...@gmail.com> wrote: > Hi Minh, > > Thanks for working on this. I think (but I'm not sure) that > docstrings delimited with ''' don't get doctests run on them, as well > as not showing up in "sage -coverage". Have you looked into that?
The script sage-coverageall uses sage-coverage to get its doctest coverage analysis of all relevant Python or Cython modules. To illustrate that the patches at ticket #8699 [1] can now handle triple single quotes, first I apply the patch at ticket #7889 [2] and use the current version of the sage-coverage script to analyze the doctest coverage of the new module introduced by that patch. For the moment, I'm not concerned about whether or not that patch applies successfully without errors. I just want a new module that uses triple single quotes. [mv...@sage sage-4.4.alpha0-7889-revolve]$ pwd /dev/shm/mvngu/sandbox/sage-4.4.alpha0-7889-revolve [mv...@sage sage-4.4.alpha0-7889-revolve]$ cd devel/sage-main/ [mv...@sage sage-main]$ ls sage/plot/plot3d/revolution_plot3d.py ls: cannot access sage/plot/plot3d/revolution_plot3d.py: No such file or directory [mv...@sage sage-main]$ hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/7889/revolution_plot3d_3.patch && hg qpush adding revolution_plot3d_3.patch to series file applying revolution_plot3d_3.patch patching file sage/plot/plot3d/all.py Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file sage/plot/plot3d/all.py.rej patch failed, unable to continue (try -v) patch failed, rejects left in working dir errors during apply, please fix and refresh revolution_plot3d_3.patch [mv...@sage sage-main]$ cat sage/plot/plot3d/all.py.rej --- all.py +++ all.py @@ -1,6 +1,6 @@ - from plot3d import plot3d from parametric_plot3d import parametric_plot3d +from revolution_plot3d import revolution_plot3d from plot_field3d import plot_vector_field3d from implicit_plot3d import implicit_plot3d from list_plot3d import list_plot3d [mv...@sage sage-main]$ ls sage/plot/plot3d/revolution_plot3d.pysage/plot/plot3d/revolution_plot3d.py [mv...@sage sage-main]$ cd ../.. [mv...@sage sage-4.4.alpha0-7889-revolve]$ ./sage -coverage devel/sage-main/sage/plot/plot3d/revolution_plot3d.py ---------------------------------------------------------------------- devel/sage-main/sage/plot/plot3d/revolution_plot3d.py SCORE devel/sage-main/sage/plot/plot3d/revolution_plot3d.py: 0% (0 of 1) Missing documentation: * revolution_plot3d(curve,trange,phirange=None,parallel_axis='z',axis=(0,0),print_vector=False,show_curve=False,**kwds): ---------------------------------------------------------------------- As you can see, the current version of the sage-coverage script doesn't handle docstrings with triple single quotes. Reading through the new module introduced by #7889, it is clear that that new module provides doctests and documentation, but the sage-coverage script fails to pick them up in its analysis. Now I apply the patches at #8699 in order to get the sage-coverage script to handle triple single quotes in its doctest analysis. [mv...@sage sage-4.4.alpha0-7889-revolve]$ cd local/bin/ [mv...@sage bin]$ hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/8699/trac_8699-documentation.patch && hg qpush adding trac_8699-documentation.patch to series file applying trac_8699-documentation.patch now at: trac_8699-documentation.patch [mv...@sage bin]$ hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/8699/trac_8699-single-quotes.patch && hg qpush adding trac_8699-single-quotes.patch to series file applying trac_8699-single-quotes.patch now at: trac_8699-single-quotes.patch [mv...@sage bin]$ cd ../.. [mv...@sage sage-4.4.alpha0-7889-revolve]$ ./sage -coverage devel/sage-main/sage/plot/plot3d/revolution_plot3d.py ---------------------------------------------------------------------- devel/sage-main/sage/plot/plot3d/revolution_plot3d.py SCORE devel/sage-main/sage/plot/plot3d/revolution_plot3d.py: 100% (1 of 1) ---------------------------------------------------------------------- Docstrings using triple single quotes are now picked up by the improved doctest coverage script. It looks to me that the issue of analyzing doctest coverage of modules with triple single quotes has been dealt with. What remains now is to handle the case of doctesting modules that use triple single quotes. That is the case I have not worked on. This issue is now tracked at ticket #8708 [3]. [1] http://trac.sagemath.org/sage_trac/ticket/8699 [2] http://trac.sagemath.org/sage_trac/ticket/7889 [3] http://trac.sagemath.org/sage_trac/ticket/8708 -- Regards Minh Van Nguyen -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org