~ubuntu-branches/ubuntu/saucy/python-scipy/saucy

« back to all changes in this revision

Viewing changes to scipy/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""\
 
2
SciPy --- A scientific computing package for Python
 
3
===================================================
 
4
 
 
5
You can support the development of SciPy by purchasing documentation
 
6
at
 
7
 
 
8
  http://www.trelgol.com
 
9
 
 
10
It is being distributed for a fee for a limited time to try and raise
 
11
money for development.
 
12
 
 
13
Documentation is also available in the docstrings.
 
14
 
 
15
"""
 
16
 
 
17
try:
 
18
    import pkg_resources as _pr # activate namespace packages (manipulates __path__)
 
19
    del _pr
 
20
except ImportError:
 
21
    pass
 
22
 
 
23
__all__ = ['pkgload','test']
 
24
 
 
25
from numpy import show_config as show_numpy_config
 
26
if show_numpy_config is None:
 
27
    raise ImportError,"Cannot import scipy when running from numpy source directory."
 
28
from numpy import __version__ as __numpy_version__
 
29
 
 
30
# Import numpy symbols to scipy name space
 
31
import numpy as _num
 
32
from numpy import oldnumeric
 
33
from numpy import *
 
34
from numpy.random import rand, randn
 
35
from numpy.fft import fft, ifft
 
36
from numpy.lib.scimath import *
 
37
_num.seterr(all='ignore')
 
38
 
 
39
__all__ += ['oldnumeric']+_num.__all__
 
40
 
 
41
__all__ += ['randn', 'rand', 'fft', 'ifft']
 
42
 
 
43
__doc__ += """
 
44
Contents
 
45
--------
 
46
 
 
47
  numpy name space
 
48
"""
 
49
del _num
 
50
# Remove the linalg imported from numpy so that the scipy.linalg package can be
 
51
# imported.
 
52
del linalg
 
53
 
 
54
from __config__ import show as show_config
 
55
from version import version as __version__
 
56
 
 
57
# Load scipy packages, their global_symbols, set up __doc__ string.
 
58
from numpy._import_tools import PackageLoader
 
59
import os as _os
 
60
SCIPY_IMPORT_VERBOSE = int(_os.environ.get('SCIPY_IMPORT_VERBOSE','-1'))
 
61
del _os
 
62
pkgload = PackageLoader()
 
63
pkgload(verbose=SCIPY_IMPORT_VERBOSE,postpone=True)
 
64
__doc__ += """
 
65
 
 
66
Available subpackages
 
67
---------------------
 
68
"""
 
69
__doc__ += pkgload.get_pkgdocs()
 
70
 
 
71
 
 
72
def test(level=1, verbosity=1):
 
73
    """ Run Scipy tests suite with level and verbosity."""
 
74
    from numpy.testing import NumpyTest
 
75
    import scipy
 
76
    scipy.pkgload()
 
77
    return NumpyTest(scipy).test(level, verbosity)
 
78
 
 
79
__doc__ += """
 
80
 
 
81
Utility tools
 
82
-------------
 
83
 
 
84
  test        --- Run scipy unittests
 
85
  pkgload     --- Load scipy packages
 
86
  show_config --- Show scipy build configuration
 
87
  show_numpy_config --- Show numpy build configuration
 
88
  __version__ --- Scipy version string
 
89
  __numpy_version__ --- Numpy version string
 
90
 
 
91
Environment variables
 
92
---------------------
 
93
 
 
94
  SCIPY_IMPORT_VERBOSE --- pkgload verbose flag, default is 0.
 
95
"""
 
96