~jtaylor/ubuntu/precise/python-numpy/multiarch-fix-818867

« back to all changes in this revision

Viewing changes to numpy/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik, Riku Voipio, Tiziano Zito, Carlos Galisteo, Ondrej Certik
  • Date: 2008-07-08 15:08:16 UTC
  • mfrom: (0.1.21 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080708150816-ekf992jcp2k1eua3
Tags: 1:1.1.0-3
[ Riku Voipio ]
* debian/control: atlas is not available on armel, and after a quick look
  neither on alpha. I'd also suggest dropping
  libatlas-sse-dev|libatlas-sse2-dev|libatlas-3dnow-dev alternative combo
  away, these are potentially dangerous on buildd's. Ondrej: dropped.
  (Closes: #489568)

[ Tiziano Zito ]
* patch: build _dotblas.c when ATLAS is not installed, build-conflict with
  atlas, build-depend on blas+lapack only, as it used to be (Closes: #489726)

[ Carlos Galisteo ]
* debian/control
  - Added Homepage field.

[ Ondrej Certik ]
* Checked the package on i386 and amd64, both with and without atlas, all
  tests run and the numpy package is faster if atlas is around. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""\
 
1
"""
2
2
NumPy
3
 
==========
4
 
 
5
 
You can support the development of NumPy and SciPy by purchasing
6
 
the book "Guide to NumPy" at
7
 
 
8
 
  http://www.trelgol.com
9
 
 
10
 
It is being distributed for a fee for only a few years to
11
 
cover some of the costs of development.  After the restriction period
12
 
it will also be freely available. 
13
 
 
14
 
Additional documentation is available in the docstrings and at
15
 
 
16
 
http://www.scipy.org.
 
3
=====
 
4
 
 
5
Provides
 
6
  1. An array object of arbitrary homogeneous items
 
7
  2. Fast mathematical operations over arrays
 
8
  3. Linear Algebra, Fourier Transforms, Random Number Generation
 
9
 
 
10
Documentation is available in the docstrings and at http://www.scipy.org
 
11
 
 
12
Available subpackages
 
13
---------------------
 
14
core
 
15
    Defines a multi-dimensional array and useful procedures
 
16
    for Numerical computation.
 
17
lib
 
18
    Basic functions used by several sub-packages and useful
 
19
    to have in the main name-space.
 
20
random
 
21
    Core Random Tools
 
22
linalg
 
23
    Core Linear Algebra Tools
 
24
fft
 
25
    Core FFT routines
 
26
testing
 
27
    Numpy testing tools
 
28
 
 
29
The following sub-packages must be explicitly imported:
 
30
 
 
31
f2py
 
32
    Fortran to Python Interface Generator.
 
33
distutils
 
34
    Enhancements to distutils with support for
 
35
    Fortran compilers support and more.
 
36
 
 
37
 
 
38
Global symbols from subpackages
 
39
-------------------------------
 
40
========  =================================
 
41
core      all (use numpy.* not numpy.core.*)
 
42
lib       all (use numpy.* not numpy.lib.*)
 
43
testing   NumpyTest
 
44
========  =================================
 
45
 
 
46
 
 
47
Utility tools
 
48
-------------
 
49
 
 
50
test
 
51
    Run numpy unittests
 
52
pkgload
 
53
    Load numpy packages
 
54
show_config
 
55
    Show numpy build configuration
 
56
dual
 
57
    Overwrite certain functions with high-performance Scipy tools
 
58
matlib
 
59
    Make everything matrices.
 
60
__version__
 
61
    Numpy version string
 
62
 
17
63
"""
18
64
 
 
65
# We first need to detect if we're being called as part of the numpy setup
 
66
# procedure itself in a reliable manner.
19
67
try:
20
 
    from __config__ import show as show_config
21
 
except ImportError:
22
 
    show_config = None
23
 
 
24
 
if show_config is None:
 
68
    __NUMPY_SETUP__
 
69
except NameError:
 
70
    __NUMPY_SETUP__ = False
 
71
 
 
72
 
 
73
if __NUMPY_SETUP__:
25
74
    import sys as _sys
26
75
    print >> _sys.stderr, 'Running from numpy source directory.'
27
76
    del _sys
28
77
else:
 
78
    try:
 
79
        from numpy.__config__ import show as show_config
 
80
    except ImportError, e:
 
81
        msg = """Error importing numpy: you should not try to import numpy from
 
82
        its source directory; please exit the numpy source tree, and relaunch
 
83
        your python intepreter from there."""
 
84
        raise ImportError(msg)
29
85
    from version import version as __version__
30
86
 
31
87
    from _import_tools import PackageLoader
32
 
    pkgload = PackageLoader()
33
 
 
 
88
 
 
89
    def pkgload(*packages, **options):
 
90
        loader = PackageLoader(infunc=True)
 
91
        return loader(*packages, **options)
 
92
 
 
93
    import add_newdocs
 
94
    __all__ = ['add_newdocs']
 
95
 
 
96
    pkgload.__doc__ = PackageLoader.__call__.__doc__
34
97
    import testing
35
98
    from testing import ScipyTest, NumpyTest
36
99
    import core
41
104
    import fft
42
105
    import random
43
106
    import ctypeslib
 
107
    import ma
44
108
 
45
109
    # Make these accessible from numpy name-space
46
110
    #  but not imported in from numpy import *
48
112
         object, unicode, str
49
113
    from core import round, abs, max, min
50
114
 
51
 
    __all__ = ['__version__', 'pkgload', 'PackageLoader',
52
 
               'ScipyTest', 'NumpyTest', 'show_config']
53
 
    __all__ += core.__all__
54
 
    __all__ += lib.__all__
55
 
    __all__ += ['linalg', 'fft', 'random', 'ctypeslib']
56
 
        
57
 
    if __doc__ is not None:
58
 
        __doc__ += """
59
 
 
60
 
Available subpackages
61
 
---------------------
62
 
core      --- Defines a multi-dimensional array and useful procedures
63
 
              for Numerical computation.
64
 
lib       --- Basic functions used by several sub-packages and useful
65
 
              to have in the main name-space.
66
 
random    --- Core Random Tools
67
 
linalg    --- Core Linear Algebra Tools
68
 
fft       --- Core FFT routines
69
 
testing   --- Scipy testing tools
70
 
 
71
 
  These packages require explicit import
72
 
f2py      --- Fortran to Python Interface Generator. 
73
 
distutils --- Enhancements to distutils with support for 
74
 
              Fortran compilers support and more. 
75
 
 
76
 
 
77
 
Global symbols from subpackages
78
 
-------------------------------
79
 
core    --> *
80
 
lib     --> *
81
 
testing --> ScipyTest, NumpyTest
82
 
"""
83
 
 
84
 
    def test(level=1, verbosity=1):
85
 
        if level <= 10: 
86
 
           return NumpyTest().test(level, verbosity)
87
 
        else:
88
 
           return NumpyTest().testall(level, verbosity)
 
115
    __all__.extend(['__version__', 'pkgload', 'PackageLoader',
 
116
               'ScipyTest', 'NumpyTest', 'show_config'])
 
117
    __all__.extend(core.__all__)
 
118
    __all__.extend(lib.__all__)
 
119
    __all__.extend(['linalg', 'fft', 'random', 'ctypeslib'])
 
120
 
 
121
    def test(*args, **kw):
 
122
        import os, sys
 
123
        print 'Numpy is installed in %s' % (os.path.split(__file__)[0],)
 
124
        print 'Numpy version %s' % (__version__,)
 
125
        print 'Python version %s' % (sys.version.replace('\n', '',),)
 
126
        return NumpyTest().test(*args, **kw)
89
127
    test.__doc__ = NumpyTest.test.__doc__
90
 
 
91
 
    import add_newdocs
92
 
 
93
 
    __all__.extend(['add_newdocs','test'])
94
 
 
95
 
    if __doc__ is not None:
96
 
        __doc__ += """
97
 
 
98
 
Utility tools
99
 
-------------
100
 
 
101
 
  test        --- Run numpy unittests
102
 
  pkgload     --- Load numpy packages
103
 
  show_config --- Show numpy build configuration
104
 
  dual        --- Overwrite certain functions with high-performance Scipy tools
105
 
  matlib      --- Make everything matrices.
106
 
  __version__ --- Numpy version string
107
 
"""