diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/__init__.py | 64 | ||||
-rw-r--r-- | numpy/_import_tools.py | 6 | ||||
-rw-r--r-- | numpy/distutils/__init__.py | 2 | ||||
-rw-r--r-- | numpy/distutils/fcompiler/ibm.py | 3 | ||||
-rw-r--r-- | numpy/f2py/__init__.py | 2 | ||||
-rw-r--r-- | numpy/lib/info.py | 6 |
6 files changed, 43 insertions, 40 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py index 41cca44af..6fc5d1b93 100644 --- a/numpy/__init__.py +++ b/numpy/__init__.py @@ -12,30 +12,6 @@ money for development. Documentation is also available in the docstrings. -Available subpackages ---------------------- - -core - Defines a multi-dimensional array and useful procedures - for Numerical computation. -lib - Basic functions used by several sub-packages and useful - to have in the main name-space -dft - Core FFT routines -linalg - Core Linear Algebra Tools -random - Core Random Tools -testing - Scipy testing tools -distutils - Enhanced distutils with Fortran compiler support and more -f2py - Fortran to Python interface generator -dual - Overwrite certain functions with high-performance Scipy tools - -Available tools ---------------- - -core, lib namespaces -fft, ifft - Functions for FFT and inverse FFT -rand, randn - Functions for uniform and normal random numbers. -test - Method to run numpy unittests. -__version__ - Numpy version string -show_config - Show numpy build configuration """ try: @@ -55,16 +31,38 @@ if show_config is None: del _sys else: from version import version as __version__ - from testing import ScipyTest - from core import * - 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__ + import os as _os + NUMPY_IMPORT_VERBOSE = int(_os.environ.get('NUMPY_IMPORT_VERBOSE','0')) + del _os + from _import_tools import PackageLoader + pkgload = PackageLoader() + pkgload('testing','core','lib','dft','random','f2py','distutils', + verbose=NUMPY_IMPORT_VERBOSE,postpone=False) - test = ScipyTest('numpy').test + __doc__ += """ + +Available subpackages +--------------------- +""" + __doc__ += pkgload.get_pkgdocs() + test = ScipyTest('numpy').test import add_newdocs + + __doc__ += """ + +Utility tools +------------- + + test --- Run numpy unittests + pkgload --- Load numpy packages + show_config --- Show numpy build configuration + dual --- Overwrite certain functions with high-performance Scipy tools + __version__ --- Numpy version string + +Environment variables +--------------------- + + NUMPY_IMPORT_VERBOSE --- pkgload verbose flag, default is 0. +""" diff --git a/numpy/_import_tools.py b/numpy/_import_tools.py index 248c68e6a..17dbb55ec 100644 --- a/numpy/_import_tools.py +++ b/numpy/_import_tools.py @@ -170,8 +170,9 @@ class PackageLoader: if package_name in self.imported_packages: continue info_module = self.info_modules[package_name] - global_symbols = getattr(info_module,'global_symbols',[]) - if postpone and not global_symbols: + global_symbols = getattr(info_module,'global_symbols',[]) + postpone_import = getattr(info_module,'postpone_import',False) + if (postpone and not global_symbols) or postpone_import: self.log('__all__.append(%r)' % (package_name)) if '.' not in package_name: self.parent_export_names.append(package_name) @@ -294,7 +295,6 @@ class PackageLoader: line += ' ' + word else: lines.append(line) - #lines.append('%s%s --- %s' % (name, w*' ', title)) return '\n'.join(lines) def get_pkgdocs(self): diff --git a/numpy/distutils/__init__.py b/numpy/distutils/__init__.py index 11657f981..3094541c1 100644 --- a/numpy/distutils/__init__.py +++ b/numpy/distutils/__init__.py @@ -5,6 +5,8 @@ from __version__ import version as __version__ import ccompiler import unixccompiler +from info import __doc__ + try: import __config__ _INSTALLED = True diff --git a/numpy/distutils/fcompiler/ibm.py b/numpy/distutils/fcompiler/ibm.py index 0468af4cb..6a216191d 100644 --- a/numpy/distutils/fcompiler/ibm.py +++ b/numpy/distutils/fcompiler/ibm.py @@ -75,6 +75,7 @@ if __name__ == '__main__': from distutils import log log.set_verbosity(2) from numpy.distutils.fcompiler import new_fcompiler - compiler = new_fcompiler(compiler='ibm') + #compiler = new_fcompiler(compiler='ibm') + compiler = IbmFCompiler() compiler.customize() print compiler.get_version() diff --git a/numpy/f2py/__init__.py b/numpy/f2py/__init__.py index 896156e16..b7b6ceb6e 100644 --- a/numpy/f2py/__init__.py +++ b/numpy/f2py/__init__.py @@ -7,6 +7,8 @@ import tempfile import sys import commands +from info import __doc__ + import f2py2e run_main = f2py2e.run_main main = f2py2e.main diff --git a/numpy/lib/info.py b/numpy/lib/info.py index 5a4d13182..bf6878b73 100644 --- a/numpy/lib/info.py +++ b/numpy/lib/info.py @@ -1,6 +1,6 @@ -__doc__ = \ -""" Basic functions used by several sub-packages and useful to have in the -main name-space +__doc_title__ = """Basic functions used by several sub-packages and +useful to have in the main name-space.""" +__doc__ = __doc_title__ + """ Type handling ============== |