diff options
author | wfspotz@sandia.gov <wfspotz@sandia.gov@localhost> | 2007-09-13 21:43:16 +0000 |
---|---|---|
committer | wfspotz@sandia.gov <wfspotz@sandia.gov@localhost> | 2007-09-13 21:43:16 +0000 |
commit | 27d4f73e33ada55df938022a841fb9023a46cc1d (patch) | |
tree | ff3cfd4dcc0f1bceb285fe1c9c6f51438798a7bb /numpy/doc/swig | |
parent | 34946e3172bbabc610cbc53132ea8e45a18d70d1 (diff) | |
download | numpy-27d4f73e33ada55df938022a841fb9023a46cc1d.tar.gz |
Reorganized swig directory with subdirectories for documentation and testing
Diffstat (limited to 'numpy/doc/swig')
-rw-r--r-- | numpy/doc/swig/Makefile | 94 | ||||
-rw-r--r-- | numpy/doc/swig/README | 39 | ||||
-rw-r--r-- | numpy/doc/swig/doc/Makefile | 51 | ||||
-rw-r--r-- | numpy/doc/swig/doc/numpy_swig.html (renamed from numpy/doc/swig/numpy_swig.html) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/doc/numpy_swig.pdf (renamed from numpy/doc/swig/numpy_swig.pdf) | bin | 150407 -> 150212 bytes | |||
-rw-r--r-- | numpy/doc/swig/doc/numpy_swig.txt (renamed from numpy/doc/swig/numpy_swig.txt) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/doc/testing.html (renamed from numpy/doc/swig/testing.html) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/doc/testing.pdf | bin | 0 -> 72436 bytes | |||
-rw-r--r-- | numpy/doc/swig/doc/testing.txt (renamed from numpy/doc/swig/testing.txt) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/test/Makefile | 27 | ||||
-rw-r--r-- | numpy/doc/swig/test/Matrix.cxx (renamed from numpy/doc/swig/Matrix.cxx) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/test/Matrix.h (renamed from numpy/doc/swig/Matrix.h) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/test/Matrix.i (renamed from numpy/doc/swig/Matrix.i) | 2 | ||||
-rw-r--r-- | numpy/doc/swig/test/Tensor.cxx (renamed from numpy/doc/swig/Tensor.cxx) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/test/Tensor.h (renamed from numpy/doc/swig/Tensor.h) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/test/Tensor.i (renamed from numpy/doc/swig/Tensor.i) | 2 | ||||
-rw-r--r-- | numpy/doc/swig/test/Vector.cxx (renamed from numpy/doc/swig/Vector.cxx) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/test/Vector.h (renamed from numpy/doc/swig/Vector.h) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/test/Vector.i (renamed from numpy/doc/swig/Vector.i) | 2 | ||||
-rwxr-xr-x | numpy/doc/swig/test/setup.py (renamed from numpy/doc/swig/setup.py) | 0 | ||||
-rwxr-xr-x | numpy/doc/swig/test/testMatrix.py (renamed from numpy/doc/swig/testMatrix.py) | 0 | ||||
-rwxr-xr-x | numpy/doc/swig/test/testTensor.py (renamed from numpy/doc/swig/testTensor.py) | 0 | ||||
-rwxr-xr-x | numpy/doc/swig/test/testVector.py (renamed from numpy/doc/swig/testVector.py) | 0 | ||||
-rw-r--r-- | numpy/doc/swig/testing.pdf | bin | 72877 -> 0 bytes |
24 files changed, 139 insertions, 78 deletions
diff --git a/numpy/doc/swig/Makefile b/numpy/doc/swig/Makefile index fc99a959f..b64492f45 100644 --- a/numpy/doc/swig/Makefile +++ b/numpy/doc/swig/Makefile @@ -1,62 +1,36 @@ -# SWIG -INTERFACES = Vector.i Matrix.i Tensor.i -WRAPPERS = $(INTERFACES:.i=_wrap.cxx) -PROXIES = $(INTERFACES:.i=.py ) - -# ReStructured Text -RST2HTML = rst2html.py -RST2LATEX = rst2latex.py -RFLAGS = --generator --time -HTML_FLAGS = --no-xml-declaration -LATEX_FLAGS = -LATEX = pdflatex - -# Web pages that need to be made -WEB_PAGES = numpy_swig.html testing.html - -# LaTeX files that need to be made -LATEX_FILES = numpy_swig.tex testing.tex - -# PDF files that need to be made -PDF_FILES = numpy_swig.pdf testing.pdf - # List all of the subdirectories here for recursive make -SUBDIRS = - -all: $(WRAPPERS) Vector.cxx Vector.h Matrix.cxx Matrix.h Tensor.cxx Tensor.h - ./setup.py build - -test: all - testVector.py - testMatrix.py - testTensor.py - -doc: html pdf - -%_wrap.cxx: %.i %.h numpy.i - swig -c++ -python $< - -html: $(WEB_PAGES) - -%.html: %.txt - $(RST2HTML) $(RFLAGS) $(HTML_FLAGS) $< $@ - -tex: $(LATEX_FILES) - -%.tex: %.txt - $(RST2LATEX) $(RFLAGS) $(LATEX_FLAGS) $< $@ - -pdf: $(PDF_FILES) - -%.pdf: %.tex - $(LATEX) $< - $(LATEX) $< - +SUBDIRS = test doc + +# Default target +.PHONY : default +default: + @echo "There is no default make target for this Makefile" + @echo "Valid make targets are:" + @echo " test - Compile and run tests of numpy.i" + @echo " doc - Generate numpy.i documentation" + @echo " all - make test + doc" + @echo " clean - Remove generated files recursively" + +# Target all +.PHONY : all +all: $(SUBDIRS) + +# Target test +.PHONY : test +test: + cd $@ && make $@ + +# Target doc +.PHONY : doc +doc: + cd $@ && make + +# Target clean +.PHONY : clean clean: - $(RM) -r build - $(RM) $(WRAPPERS) - $(RM) $(PROXIES) - $(RM) $(LATEX_FILES) - $(RM) *.pyc *.aux *.dvi *.log *.out *~ - -.PHONY : all test doc html tex pdf clean + @for dir in $(SUBDIRS); do \ + echo ; \ + echo Running \'make clean\' in $$dir; \ + cd $$dir && make clean && cd ..; \ + done; \ + echo diff --git a/numpy/doc/swig/README b/numpy/doc/swig/README index 40d7f9636..d557b305f 100644 --- a/numpy/doc/swig/README +++ b/numpy/doc/swig/README @@ -7,9 +7,30 @@ and C++ code that uses C arrays and the python module NumPy. It is ultimately hoped that numpy.i will be included as part of the SWIG distribution. -In the spirit of "writing your tests first", I will begin by -describing the tests, as they are a good example of what we are trying -to do with numpy.i. The files related to testing are:: +Documentation +------------- +Documentation for how to use numpy.i is in the doc directory. The +primary source file here is numpy_swig.txt, a restructured text file +that documents how to use numpy.i. The Makefile in doc allows for the +conversion of numpy_swig.txt to HTML (if you have docutils installed) +and to PDF (if you have docutils and latex/pdftex installed). This +should not be necessary, however, as numpy_swig.html and +numpy_swig.pdf are stored in the repository. + +The same is true for a file called doc/testing.txt, which describes +the testing system used here. + +If you have the prerequisites installed and wish to build the HTML and +PDF documentation, this can be achieved by calling:: + + $ make doc + +from the shell. + +Testing +------- +The tests are a good example of what we are trying to do with numpy.i. +The files related to testing are are in the test subdirectory:: Vector.h Vector.cxx @@ -106,16 +127,4 @@ PDF documentation (with make targets "tex" and "pdf"). To build and run the test code, simply execute from the shell:: - $ make $ make test - -================================================================================ - -ToDo ----- - - * Add ARGOUT typemaps that assume the function allocates the buffers - internally. - - * Add "naked" typemaps for argument lists that do not specify - dimensions. diff --git a/numpy/doc/swig/doc/Makefile b/numpy/doc/swig/doc/Makefile new file mode 100644 index 000000000..9223f0481 --- /dev/null +++ b/numpy/doc/swig/doc/Makefile @@ -0,0 +1,51 @@ +# ReStructured Text +RST2HTML = rst2html.py +RST2LATEX = rst2latex.py +RFLAGS = --generator --time +HTML_FLAGS = --no-xml-declaration +LATEX_FLAGS = +LATEX = pdflatex + +# Web pages that need to be made +WEB_PAGES = numpy_swig.html testing.html + +# LaTeX files that need to be made +LATEX_FILES = numpy_swig.tex testing.tex + +# PDF files that need to be made +PDF_FILES = numpy_swig.pdf testing.pdf + +# Default target: documentation +.PHONY : doc +doc: html pdf + +# HTML target +.PHONY : html +html: $(WEB_PAGES) + +# Rule: %.txt -> %.html +%.html: %.txt + $(RST2HTML) $(RFLAGS) $(HTML_FLAGS) $< $@ + +# LaTeX target +.PHONY : tex +tex: $(LATEX_FILES) + +# Rule: %.txt -> %.tex +%.tex: %.txt + $(RST2LATEX) $(RFLAGS) $(LATEX_FLAGS) $< $@ + +# PDF target +.PHONY : pdf +pdf: $(PDF_FILES) + +# Rule: %.tex -> %.pdf +%.pdf: %.tex + $(LATEX) $< + $(LATEX) $< + +# Clean target +.PHONY : clean +clean: + $(RM) $(LATEX_FILES) + $(RM) *.pyc *.aux *.dvi *.log *.out *~ diff --git a/numpy/doc/swig/numpy_swig.html b/numpy/doc/swig/doc/numpy_swig.html index b3055fe5d..b3055fe5d 100644 --- a/numpy/doc/swig/numpy_swig.html +++ b/numpy/doc/swig/doc/numpy_swig.html diff --git a/numpy/doc/swig/numpy_swig.pdf b/numpy/doc/swig/doc/numpy_swig.pdf Binary files differindex 54cbd52da..c85019314 100644 --- a/numpy/doc/swig/numpy_swig.pdf +++ b/numpy/doc/swig/doc/numpy_swig.pdf diff --git a/numpy/doc/swig/numpy_swig.txt b/numpy/doc/swig/doc/numpy_swig.txt index 3103f1d39..3103f1d39 100644 --- a/numpy/doc/swig/numpy_swig.txt +++ b/numpy/doc/swig/doc/numpy_swig.txt diff --git a/numpy/doc/swig/testing.html b/numpy/doc/swig/doc/testing.html index 3622550df..3622550df 100644 --- a/numpy/doc/swig/testing.html +++ b/numpy/doc/swig/doc/testing.html diff --git a/numpy/doc/swig/doc/testing.pdf b/numpy/doc/swig/doc/testing.pdf Binary files differnew file mode 100644 index 000000000..33430b3be --- /dev/null +++ b/numpy/doc/swig/doc/testing.pdf diff --git a/numpy/doc/swig/testing.txt b/numpy/doc/swig/doc/testing.txt index bfd5218e8..bfd5218e8 100644 --- a/numpy/doc/swig/testing.txt +++ b/numpy/doc/swig/doc/testing.txt diff --git a/numpy/doc/swig/test/Makefile b/numpy/doc/swig/test/Makefile new file mode 100644 index 000000000..7b85b3c21 --- /dev/null +++ b/numpy/doc/swig/test/Makefile @@ -0,0 +1,27 @@ +# SWIG +INTERFACES = Vector.i Matrix.i Tensor.i +WRAPPERS = $(INTERFACES:.i=_wrap.cxx) +PROXIES = $(INTERFACES:.i=.py ) + +# Default target: build the tests +.PHONY : all +all: $(WRAPPERS) Vector.cxx Vector.h Matrix.cxx Matrix.h Tensor.cxx Tensor.h + ./setup.py build + +# Test target: run the tests +.PHONY : test +test: all + testVector.py + testMatrix.py + testTensor.py + +# Rule: %.i -> %_wrap.cxx +%_wrap.cxx: %.i %.h ../numpy.i + swig -c++ -python $< + +# Clean target +.PHONY : clean +clean: + $(RM) -r build + $(RM) $(WRAPPERS) + $(RM) $(PROXIES) diff --git a/numpy/doc/swig/Matrix.cxx b/numpy/doc/swig/test/Matrix.cxx index b953d7017..b953d7017 100644 --- a/numpy/doc/swig/Matrix.cxx +++ b/numpy/doc/swig/test/Matrix.cxx diff --git a/numpy/doc/swig/Matrix.h b/numpy/doc/swig/test/Matrix.h index f37836cc4..f37836cc4 100644 --- a/numpy/doc/swig/Matrix.h +++ b/numpy/doc/swig/test/Matrix.h diff --git a/numpy/doc/swig/Matrix.i b/numpy/doc/swig/test/Matrix.i index 4e14b138d..e721397a0 100644 --- a/numpy/doc/swig/Matrix.i +++ b/numpy/doc/swig/test/Matrix.i @@ -7,7 +7,7 @@ %} // Get the NumPy typemaps -%include "numpy.i" +%include "../numpy.i" %init %{ import_array(); diff --git a/numpy/doc/swig/Tensor.cxx b/numpy/doc/swig/test/Tensor.cxx index dce595291..dce595291 100644 --- a/numpy/doc/swig/Tensor.cxx +++ b/numpy/doc/swig/test/Tensor.cxx diff --git a/numpy/doc/swig/Tensor.h b/numpy/doc/swig/test/Tensor.h index d60eb2d2e..d60eb2d2e 100644 --- a/numpy/doc/swig/Tensor.h +++ b/numpy/doc/swig/test/Tensor.h diff --git a/numpy/doc/swig/Tensor.i b/numpy/doc/swig/test/Tensor.i index 24c906d29..a1198dc9e 100644 --- a/numpy/doc/swig/Tensor.i +++ b/numpy/doc/swig/test/Tensor.i @@ -7,7 +7,7 @@ %} // Get the NumPy typemaps -%include "numpy.i" +%include "../numpy.i" %init %{ import_array(); diff --git a/numpy/doc/swig/Vector.cxx b/numpy/doc/swig/test/Vector.cxx index 2c90404da..2c90404da 100644 --- a/numpy/doc/swig/Vector.cxx +++ b/numpy/doc/swig/test/Vector.cxx diff --git a/numpy/doc/swig/Vector.h b/numpy/doc/swig/test/Vector.h index 01da361c6..01da361c6 100644 --- a/numpy/doc/swig/Vector.h +++ b/numpy/doc/swig/test/Vector.h diff --git a/numpy/doc/swig/Vector.i b/numpy/doc/swig/test/Vector.i index 1cb689250..e86f21c37 100644 --- a/numpy/doc/swig/Vector.i +++ b/numpy/doc/swig/test/Vector.i @@ -7,7 +7,7 @@ %} // Get the NumPy typemaps -%include "numpy.i" +%include "../numpy.i" %init %{ import_array(); diff --git a/numpy/doc/swig/setup.py b/numpy/doc/swig/test/setup.py index 13bd7589e..13bd7589e 100755 --- a/numpy/doc/swig/setup.py +++ b/numpy/doc/swig/test/setup.py diff --git a/numpy/doc/swig/testMatrix.py b/numpy/doc/swig/test/testMatrix.py index 933423fe9..933423fe9 100755 --- a/numpy/doc/swig/testMatrix.py +++ b/numpy/doc/swig/test/testMatrix.py diff --git a/numpy/doc/swig/testTensor.py b/numpy/doc/swig/test/testTensor.py index f68e6b720..f68e6b720 100755 --- a/numpy/doc/swig/testTensor.py +++ b/numpy/doc/swig/test/testTensor.py diff --git a/numpy/doc/swig/testVector.py b/numpy/doc/swig/test/testVector.py index 82a922e25..82a922e25 100755 --- a/numpy/doc/swig/testVector.py +++ b/numpy/doc/swig/test/testVector.py diff --git a/numpy/doc/swig/testing.pdf b/numpy/doc/swig/testing.pdf Binary files differdeleted file mode 100644 index ad0342da2..000000000 --- a/numpy/doc/swig/testing.pdf +++ /dev/null |