summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2006-01-05 10:40:20 +0000
committerPearu Peterson <pearu.peterson@gmail.com>2006-01-05 10:40:20 +0000
commitcec9a2ee40ef84dab429e71825ea9c4c9765aa40 (patch)
tree835e03570e5de29b69f6ce1493ead2e7031905e7
parent8b1e2f929fdfb79e0a446a1fb7bec33a799d492b (diff)
downloadnumpy-cec9a2ee40ef84dab429e71825ea9c4c9765aa40.tar.gz
Cleaning up __all__ list and numpy namespace.
-rw-r--r--numpy/__init__.py17
-rw-r--r--numpy/core/__init__.py6
-rwxr-xr-xnumpy/f2py/f2py2e.py2
-rw-r--r--numpy/lib/__init__.py14
-rw-r--r--numpy/lib/function_base.py4
-rw-r--r--numpy/lib/tests/test_index_tricks.py1
-rw-r--r--numpy/lib/tests/test_twodim_base.py1
7 files changed, 35 insertions, 10 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py
index 706959e90..107afcd00 100644
--- a/numpy/__init__.py
+++ b/numpy/__init__.py
@@ -16,8 +16,9 @@ Available subpackages
---------------------
"""
-import os, sys
-NUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))
+import os as _os
+import sys as _sys
+NUMPY_IMPORT_VERBOSE = int(_os.environ.get('NUMPY_IMPORT_VERBOSE','0'))
try:
from __config__ import show as show_config
@@ -25,12 +26,13 @@ except ImportError:
show_config = None
try:
- import pkg_resources # activate namespace packages (manipulates __path__)
+ import pkg_resources as _pk # activate namespace packages (manipulates __path__)
+ del _pk
except ImportError:
pass
if show_config is None:
- print >> sys.stderr, 'Running from numpy source directory.'
+ print >> _sys.stderr, 'Running from numpy source directory.'
else:
from version import version as __version__
from testing import ScipyTest
@@ -38,6 +40,11 @@ else:
from lib import *
from dft import fft, ifft
from random import rand, randn
+
+ __all__ = ['ScipyTest','fft','ifft','rand','randn']
+ __all__ += core.__all__
+ __all__ += lib.__all__
+
__all__ = filter(lambda s:not s.startswith('_'),dir())
test = ScipyTest('numpy').test
@@ -45,3 +52,5 @@ else:
import add_newdocs
# TODO: Fix __doc__
+
+del _os, _sys
diff --git a/numpy/core/__init__.py b/numpy/core/__init__.py
index 8ff2bf565..21085206d 100644
--- a/numpy/core/__init__.py
+++ b/numpy/core/__init__.py
@@ -17,7 +17,11 @@ from records import *
from memmap import *
del nt
-__all__ = filter(lambda s:not s.startswith('_'),dir())
+__all__ = ['char','rec','memmap']
+__all__ += numeric.__all__
+__all__ += oldnumeric.__all__
+__all__ += defmatrix.__all__
+__all__ += records.__all__
from numpy.testing import ScipyTest
test = ScipyTest().test
diff --git a/numpy/f2py/f2py2e.py b/numpy/f2py/f2py2e.py
index 126f80646..b8416c973 100755
--- a/numpy/f2py/f2py2e.py
+++ b/numpy/f2py/f2py2e.py
@@ -160,7 +160,7 @@ Extra options (only effective with -c):
a message should be shown.
Version: %s
-numpy_core Version: %s
+numpy Version: %s
Requires: Python 2.3 or higher.
License: LGPL (see http://www.fsf.org)
Copyright 1999 - 2005 Pearu Peterson all rights reserved.
diff --git a/numpy/lib/__init__.py b/numpy/lib/__init__.py
index 13c5ec10b..34a39e63b 100644
--- a/numpy/lib/__init__.py
+++ b/numpy/lib/__init__.py
@@ -13,10 +13,20 @@ import scimath as math
from polynomial import *
from machar import *
from getlimits import *
-import convertcode
+#import convertcode
from utils import *
-__all__ = filter(lambda s:not s.startswith('_'),dir())
+__all__ = []
+__all__ += type_check.__all__
+__all__ += index_tricks.__all__
+__all__ += function_base.__all__
+__all__ += shape_base.__all__
+__all__ += twodim_base.__all__
+__all__ += ufunclike.__all__
+__all__ += polynomial.__all__
+__all__ += machar.__all__
+__all__ += getlimits.__all__
+__all__ += utils.__all__
from numpy.testing import ScipyTest
test = ScipyTest().test
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index d0b3535d0..b3c94a264 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -1,7 +1,7 @@
-l__all__ = ['logspace', 'linspace',
+__all__ = ['logspace', 'linspace',
'select', 'piecewise', 'trim_zeros',
- 'copy', 'iterable', 'base_repr', 'binary_repr',
+ 'copy', 'iterable', #'base_repr', 'binary_repr',
'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',
'unique', 'extract', 'insert', 'nansum', 'nanmax', 'nanargmax',
'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
index 13d565b4c..315bb3533 100644
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -2,6 +2,7 @@
from numpy.testing import *
set_package_path()
import numpy.lib;reload(numpy.lib)
+from numpy import *
from numpy.lib import *
restore_path()
diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py
index 1ed309f7c..4213078c5 100644
--- a/numpy/lib/tests/test_twodim_base.py
+++ b/numpy/lib/tests/test_twodim_base.py
@@ -5,6 +5,7 @@
from numpy.testing import *
set_package_path()
import numpy.lib;reload(numpy.lib)
+from numpy import *
from numpy.lib import *
restore_path()