[Numpy-svn] r6096 - numpy-docs/trunk trunk/doc

numpy-svn@scip... numpy-svn@scip...
Sun Nov 23 04:39:23 CST 2008


Author: ptvirtan
Date: 2008-11-23 04:39:05 -0600 (Sun, 23 Nov 2008)
New Revision: 6096

Added:
   trunk/doc/Makefile
   trunk/doc/README.txt
   trunk/doc/postprocess.py
   trunk/doc/source/
   trunk/doc/summarize.py
Removed:
   numpy-docs/trunk/Makefile
   numpy-docs/trunk/README.txt
   numpy-docs/trunk/postprocess.py
   numpy-docs/trunk/source/
   numpy-docs/trunk/summarize.py
Log:
Moved numpy-docs under doc/ in the main Numpy trunk.


Deleted: numpy-docs/trunk/Makefile
===================================================================
--- numpy-docs/trunk/Makefile	2008-11-23 00:13:48 UTC (rev 6095)
+++ numpy-docs/trunk/Makefile	2008-11-23 10:39:05 UTC (rev 6096)
@@ -1,98 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS    =
-SPHINXBUILD   = LANG=C sphinx-build
-PAPER         =
-
-# Internal variables.
-PAPEROPT_a4     = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
-
-.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
-
-help:
-	@echo "Please use \`make <target>' where <target> is one of"
-	@echo "  dist      to make a distribution-ready tree"
-	@echo "  html      to make standalone HTML files"
-	@echo "  pickle    to make pickle files (usable by e.g. sphinx-web)"
-	@echo "  htmlhelp  to make HTML files and a HTML help project"
-	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
-	@echo "  changes   to make an overview over all changed/added/deprecated items"
-	@echo "  linkcheck to check all external links for integrity"
-
-clean:
-	-rm -rf build/* source/reference/generated
-
-dist: html
-	test -d build/latex || make latex
-	make -C build/latex all-pdf
-	-rm -rf build/dist
-	cp -r build/html build/dist
-	perl -pi -e 's#^\s*(<li><a href=".*?">NumPy.*?Manual.*?&raquo;</li>)#<li><a href="/">Numpy and Scipy Documentation</a> &raquo;</li>#;' build/dist/*.html build/dist/*/*.html build/dist/*/*/*.html
-	cd build/html && zip -9r ../dist/numpy-html.zip .
-	cp build/latex/*.pdf build/dist
-	cd build/dist && tar czf ../dist.tar.gz *
-
-generate: build/generate-stamp
-build/generate-stamp: $(wildcard source/reference/*.rst) ext
-	mkdir -p build
-	./ext/autosummary_generate.py source/reference/*.rst \
-		-p dump.xml -o source/reference/generated 
-	touch build/generate-stamp
-
-ext:
-	svn co http://sphinx.googlecode.com/svn/contrib/trunk/numpyext ext
-
-html: generate
-	mkdir -p build/html build/doctrees
-	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html
-	python postprocess.py html build/html/*.html
-	@echo
-	@echo "Build finished. The HTML pages are in build/html."
-
-pickle: generate
-	mkdir -p build/pickle build/doctrees
-	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle
-	@echo
-	@echo "Build finished; now you can process the pickle files or run"
-	@echo "  sphinx-web build/pickle"
-	@echo "to start the sphinx-web server."
-
-web: pickle
-
-htmlhelp: generate
-	mkdir -p build/htmlhelp build/doctrees
-	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp
-	@echo
-	@echo "Build finished; now you can run HTML Help Workshop with the" \
-	      ".hhp project file in build/htmlhelp."
-
-latex: generate
-	mkdir -p build/latex build/doctrees
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex
-	python postprocess.py tex build/latex/*.tex
-	@echo
-	@echo "Build finished; the LaTeX files are in build/latex."
-	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
-	      "run these through (pdf)latex."
-
-coverage: build
-	mkdir -p build/coverage build/doctrees
-	$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) build/coverage
-	@echo "Coverage finished; see c.txt and python.txt in build/coverage"
-
-changes: generate
-	mkdir -p build/changes build/doctrees
-	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes
-	@echo
-	@echo "The overview file is in build/changes."
-
-linkcheck: generate
-	mkdir -p build/linkcheck build/doctrees
-	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck
-	@echo
-	@echo "Link check complete; look for any errors in the above output " \
-	      "or in build/linkcheck/output.txt."

Deleted: numpy-docs/trunk/README.txt
===================================================================
--- numpy-docs/trunk/README.txt	2008-11-23 00:13:48 UTC (rev 6095)
+++ numpy-docs/trunk/README.txt	2008-11-23 10:39:05 UTC (rev 6096)
@@ -1,40 +0,0 @@
-NumPy Reference Guide
-=====================
-
-Instructions
-------------
-1. Optionally download an XML dump of the newest docstrings from the doc wiki
-   at ``/pydocweb/dump`` and save it as ``dump.xml``.
-2. Run ``make html`` or ``make dist``
-
-You can also run ``summarize.py`` to see which parts of the Numpy
-namespace are documented.
-
-
-TODO
-----
-
-* Numberless [*] footnotes cause LaTeX errors.
-
-* ``See also`` sections are still somehow broken even if some work.
-  The problem is that Sphinx searches like this::
-
-      'name'
-      'active_module.name'
-      'active_module.active_class.name'.
-  
-  Whereas, we would like to have this:
-
-      'name'
-      'active_module.name'
-      'parent_of_active_module.name'
-      'parent_of_parent_of_active_module.name'
-      ...
-      'numpy.name'
-
-  We can get one step upwards by always using 'numpy' as the active module.
-  It seems difficult to beat Sphinx to do what we want.
-  Do we need to change our docstring standard slightly, ie. allow only
-  leaving the 'numpy.' prefix away?
-
-* Link resolution doesn't work as intended... eg. `doc.ufunc`_

Deleted: numpy-docs/trunk/postprocess.py
===================================================================
--- numpy-docs/trunk/postprocess.py	2008-11-23 00:13:48 UTC (rev 6095)
+++ numpy-docs/trunk/postprocess.py	2008-11-23 10:39:05 UTC (rev 6096)
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-"""
-%prog MODE FILES...
-
-Post-processes HTML and Latex files output by Sphinx.
-MODE is either 'html' or 'tex'.
-
-"""
-import re, optparse
-
-def main():
-    p = optparse.OptionParser(__doc__)
-    options, args = p.parse_args()
-
-    if len(args) < 1:
-        p.error('no mode given')
-
-    mode = args.pop(0)
-
-    if mode not in ('html', 'tex'):
-        p.error('unknown mode %s' % mode)
-
-    for fn in args:
-        f = open(fn, 'r')
-        try:
-            if mode == 'html':
-                lines = process_html(fn, f.readlines())
-            elif mode == 'tex':
-                lines = process_tex(f.readlines())
-        finally:
-            f.close()
-
-        f = open(fn, 'w')
-        f.write("".join(lines))
-        f.close()
-
-def process_html(fn, lines):
-    return lines
-
-def process_tex(lines):
-    """
-    Remove unnecessary section titles from the LaTeX file.
-    
-    """
-    new_lines = []
-    for line in lines:
-        if (line.startswith(r'\section{numpy.')
-            or line.startswith(r'\subsection{numpy.')
-            or line.startswith(r'\subsubsection{numpy.')
-            or line.startswith(r'\paragraph{numpy.')
-            or line.startswith(r'\subparagraph{numpy.')
-            ):
-            pass # skip!
-        else:
-            new_lines.append(line)
-    return new_lines
-
-if __name__ == "__main__":
-    main()

Deleted: numpy-docs/trunk/summarize.py
===================================================================
--- numpy-docs/trunk/summarize.py	2008-11-23 00:13:48 UTC (rev 6095)
+++ numpy-docs/trunk/summarize.py	2008-11-23 10:39:05 UTC (rev 6096)
@@ -1,167 +0,0 @@
-#!/usr/bin/env python
-"""
-summarize.py
-
-Show a summary about which Numpy functions are documented and which are not.
-
-"""
-
-import os, glob, re, sys, inspect, optparse
-sys.path.append(os.path.join(os.path.dirname(__file__), 'ext'))
-from ext.phantom_import import import_phantom_module
-
-from ext.autosummary_generate import get_documented
-
-CUR_DIR = os.path.dirname(__file__)
-SOURCE_DIR = os.path.join(CUR_DIR, 'source', 'reference')
-
-SKIP_LIST = """
-# --- aliases:
-alltrue sometrue bitwise_not cumproduct
-row_stack column_stack product rank
-
-# -- skipped:
-core lib f2py dual doc emath ma rec char distutils oldnumeric numarray
-testing version matlib
-
-add_docstring add_newdoc add_newdocs fastCopyAndTranspose pkgload
-conjugate disp
-
-int0 object0 unicode0 uint0 string_ string0 void0
-
-flagsobj
-
-setup setupscons PackageLoader
-
-lib.scimath.arccos lib.scimath.arcsin lib.scimath.arccosh lib.scimath.arcsinh
-lib.scimath.arctanh lib.scimath.log lib.scimath.log2 lib.scimath.log10
-lib.scimath.logn lib.scimath.power lib.scimath.sqrt
-
-# --- numpy.random:
-random random.info random.mtrand random.ranf random.sample random.random
-
-# --- numpy.fft:
-fft fft.Tester fft.bench fft.fftpack fft.fftpack_lite fft.helper
-fft.refft fft.refft2 fft.refftn fft.irefft fft.irefft2 fft.irefftn
-fft.info fft.test
-
-# --- numpy.linalg:
-linalg linalg.Tester
-linalg.bench linalg.info linalg.lapack_lite linalg.linalg linalg.test
-
-# --- numpy.ctypeslib:
-ctypeslib ctypeslib.test
-
-""".split()
-
-def main():
-    p = optparse.OptionParser(__doc__)
-    options, args = p.parse_args()
-
-    if len(args) != 0:
-        p.error('Wrong number of arguments')
-
-    # prepare
-    fn = os.path.join(CUR_DIR, 'dump.xml')
-    if os.path.isfile(fn):
-        import_phantom_module(fn)
-    
-    # check
-    documented, undocumented = check_numpy()
-    
-    # report
-    in_sections = {}
-    for name, locations in documented.iteritems():
-        for (filename, section, keyword, toctree) in locations:
-            in_sections.setdefault((filename, section, keyword), []).append(name)
-
-    print "Documented"
-    print "==========\n"
-
-    last_filename = None
-    for (filename, section, keyword), names in sorted(in_sections.items()):
-        if filename != last_filename:
-            print "--- %s\n" % filename
-        last_filename = filename
-        print " ** ", section
-        print format_in_columns(sorted(names))
-        print "\n"
-
-    print ""
-    print "Undocumented"
-    print "============\n"
-    print format_in_columns(sorted(undocumented.keys()))
-
-def check_numpy():
-    documented = get_documented(glob.glob(SOURCE_DIR + '/*.rst'))
-    undocumented = {}
-
-    import numpy, numpy.fft, numpy.linalg, numpy.random
-    for mod in [numpy, numpy.fft, numpy.linalg, numpy.random,
-                numpy.ctypeslib, numpy.emath, numpy.ma]:
-        undocumented.update(get_undocumented(documented, mod, skip=SKIP_LIST))
-
-    for d in (documented, undocumented):
-        for k in d.keys():
-            if k.startswith('numpy.'):
-                d[k[6:]] = d[k]
-                del d[k]
-    
-    return documented, undocumented
-
-def get_undocumented(documented, module, module_name=None, skip=[]):
-    """
-    Find out which items in Numpy are not documented.
-
-    Returns
-    -------
-    undocumented : dict of bool
-        Dictionary containing True for each documented item name
-        and False for each undocumented one.
-
-    """
-    undocumented = {}
-    
-    if module_name is None:
-        module_name = module.__name__
-    
-    for name in dir(module):
-        obj = getattr(module, name)
-        if name.startswith('_'): continue
-        
-        full_name = '.'.join([module_name, name])
-
-        if full_name in skip: continue
-        if full_name.startswith('numpy.') and full_name[6:] in skip: continue
-        if not (inspect.ismodule(obj) or callable(obj) or inspect.isclass(obj)):
-            continue
-        
-        if full_name not in documented:
-            undocumented[full_name] = True
-    
-    return undocumented
-
-def format_in_columns(lst):
-    """
-    Format a list containing strings to a string containing the items
-    in columns.
-    """
-    lst = map(str, lst)
-    col_len = max(map(len, lst)) + 2
-    ncols = 80//col_len
-    if ncols == 0:
-        ncols = 1
-
-    if len(lst) % ncols == 0:
-        nrows = len(lst)//ncols
-    else:
-        nrows = 1 + len(lst)//ncols
-    
-    fmt = ' %%-%ds ' % (col_len-2)
-    
-    lines = []
-    for n in range(nrows):
-        lines.append("".join([fmt % x for x in lst[n::nrows]]))
-    return "\n".join(lines)
-
-if __name__ == "__main__": main()

Copied: trunk/doc/Makefile (from rev 6095, numpy-docs/trunk/Makefile)

Copied: trunk/doc/README.txt (from rev 6095, numpy-docs/trunk/README.txt)

Copied: trunk/doc/postprocess.py (from rev 6095, numpy-docs/trunk/postprocess.py)

Copied: trunk/doc/source (from rev 6095, numpy-docs/trunk/source)

Copied: trunk/doc/summarize.py (from rev 6095, numpy-docs/trunk/summarize.py)



More information about the Numpy-svn mailing list