diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-02-27 13:26:58 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-03-01 11:22:47 -0700 |
commit | 6aa264c4bad9c89ccdd9ecd5a1cb5ef10643ec51 (patch) | |
tree | 15cad18dacf1ef03380c957ed9af4f39b94c5012 /doc/numpybook | |
parent | 3c13c0a925276130d66be490eed4ae337712cce2 (diff) | |
download | numpy-6aa264c4bad9c89ccdd9ecd5a1cb5ef10643ec51.tar.gz |
2to3: Put `from __future__ import division in every python file.
This should be harmless, as we already are division clean. However,
placement of this import takes some care. In the future a script
can be used to append new features without worry, at least until
such time as it exceeds a single line. Having that ability will
make it easier to deal with absolute imports and printing updates.
Diffstat (limited to 'doc/numpybook')
-rw-r--r-- | doc/numpybook/comparison/ctypes/filter.py | 2 | ||||
-rw-r--r-- | doc/numpybook/comparison/ctypes/interface.py | 2 | ||||
-rw-r--r-- | doc/numpybook/comparison/pyrex/setup.py | 1 | ||||
-rw-r--r-- | doc/numpybook/comparison/timing.py | 1 | ||||
-rw-r--r-- | doc/numpybook/comparison/weave/filter.py | 2 | ||||
-rw-r--r-- | doc/numpybook/comparison/weave/inline.py | 2 | ||||
-rw-r--r-- | doc/numpybook/runcode.py | 31 |
7 files changed, 27 insertions, 14 deletions
diff --git a/doc/numpybook/comparison/ctypes/filter.py b/doc/numpybook/comparison/ctypes/filter.py index 1b322aca3..ebc274f31 100644 --- a/doc/numpybook/comparison/ctypes/filter.py +++ b/doc/numpybook/comparison/ctypes/filter.py @@ -1,3 +1,5 @@ +from __future__ import division + __all__ = ['filter2d'] import numpy as N diff --git a/doc/numpybook/comparison/ctypes/interface.py b/doc/numpybook/comparison/ctypes/interface.py index e237f8ded..ab1b14731 100644 --- a/doc/numpybook/comparison/ctypes/interface.py +++ b/doc/numpybook/comparison/ctypes/interface.py @@ -1,3 +1,5 @@ +from __future__ import division + __all__ = ['add', 'filter2d'] import numpy as N diff --git a/doc/numpybook/comparison/pyrex/setup.py b/doc/numpybook/comparison/pyrex/setup.py index 695639d9e..f0c764955 100644 --- a/doc/numpybook/comparison/pyrex/setup.py +++ b/doc/numpybook/comparison/pyrex/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import division from distutils.core import setup from distutils.extension import Extension diff --git a/doc/numpybook/comparison/timing.py b/doc/numpybook/comparison/timing.py index 92f6a50d2..18004855e 100644 --- a/doc/numpybook/comparison/timing.py +++ b/doc/numpybook/comparison/timing.py @@ -1,3 +1,4 @@ +from __future__ import division import timeit diff --git a/doc/numpybook/comparison/weave/filter.py b/doc/numpybook/comparison/weave/filter.py index 41992708d..519a54c5b 100644 --- a/doc/numpybook/comparison/weave/filter.py +++ b/doc/numpybook/comparison/weave/filter.py @@ -1,3 +1,5 @@ +from __future__ import division + from scipy import weave, zeros_like def filter(a): diff --git a/doc/numpybook/comparison/weave/inline.py b/doc/numpybook/comparison/weave/inline.py index 0bf62ffe8..1f98b7a62 100644 --- a/doc/numpybook/comparison/weave/inline.py +++ b/doc/numpybook/comparison/weave/inline.py @@ -1,3 +1,5 @@ +from __future__ import division + from scipy import weave from numpy import rand, zeros_like diff --git a/doc/numpybook/runcode.py b/doc/numpybook/runcode.py index 7ec303500..92784d34e 100644 --- a/doc/numpybook/runcode.py +++ b/doc/numpybook/runcode.py @@ -1,17 +1,20 @@ -# This script takes a lyx file and runs the python code in it. -# Then rewrites the lyx file again. -# -# Each section of code portion is assumed to be in the same namespace -# where a from numpy import * has been applied -# -# If a PYNEW inside a Note is encountered, the name space is restarted -# -# The output (if any) is replaced in the file -# by the output produced during the code run. -# -# Options: -# -n name of code section (default MyCode) -# +""" +This script takes a lyx file and runs the python code in it. + Then rewrites the lyx file again. + +Each section of code portion is assumed to be in the same namespace +where a from numpy import * has been applied + + If a PYNEW inside a Note is encountered, the name space is restarted + +The output (if any) is replaced in the file + by the output produced during the code run. + +Options: + -n name of code section (default MyCode) + +""" +from __future__ import division import sys import optparse |