diff --git a/scipy/__init__.py b/scipy/__init__.py index f6f76858a0df..ad5cd5dbfe77 100644 --- a/scipy/__init__.py +++ b/scipy/__init__.py @@ -73,7 +73,7 @@ """ -__all__ = ['pkgload','test'] +__all__ = ['test'] from numpy import show_config as show_numpy_config if show_numpy_config is None: @@ -115,14 +115,6 @@ raise ImportError(msg) from scipy.version import version as __version__ -# Load scipy packages and their global_symbols -from numpy._import_tools import PackageLoader -import os as _os -SCIPY_IMPORT_VERBOSE = int(_os.environ.get('SCIPY_IMPORT_VERBOSE','-1')) -del _os -pkgload = PackageLoader() -pkgload(verbose=SCIPY_IMPORT_VERBOSE,postpone=True) - from numpy.testing import Tester test = Tester().test bench = Tester().bench diff --git a/scipy/cluster/__init__.py b/scipy/cluster/__init__.py index 3dd52db353ba..0a0e82ccca79 100644 --- a/scipy/cluster/__init__.py +++ b/scipy/cluster/__init__.py @@ -1,8 +1,25 @@ -# -# spatial - Distances -# +""" +========================================= +Clustering package (:mod:`scipy.cluster`) +========================================= -from info import __doc__ +.. currentmodule:: scipy.cluster + +:mod:`scipy.cluster.vq` + +Clustering algorithms are useful in information theory, target detection, +communications, compression, and other areas. The `vq` module only +supports vector quantization and the k-means algorithms. + +:mod:`scipy.cluster.hierarchy` + +The `hierarchy` module provides functions for hierarchical and +agglomerative clustering. Its features include generating hierarchical +clusters from distance matrices, computing distance matrices from +observation vectors, calculating statistics on clusters, cutting linkages +to generate flat clusters, and visualizing clusters with dendrograms. + +""" __all__ = ['vq', 'hierarchy'] diff --git a/scipy/cluster/info.py b/scipy/cluster/info.py deleted file mode 100644 index 4c9487c33269..000000000000 --- a/scipy/cluster/info.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -========================================= -Clustering package (:mod:`scipy.cluster`) -========================================= - -.. currentmodule:: scipy.cluster - -:mod:`scipy.cluster.vq` - -Clustering algorithms are useful in information theory, target detection, -communications, compression, and other areas. The `vq` module only -supports vector quantization and the k-means algorithms. - -:mod:`scipy.cluster.hierarchy` - -The `hierarchy` module provides functions for hierarchical and -agglomerative clustering. Its features include generating hierarchical -clusters from distance matrices, computing distance matrices from -observation vectors, calculating statistics on clusters, cutting linkages -to generate flat clusters, and visualizing clusters with dendrograms. - -""" diff --git a/scipy/constants/__init__.py b/scipy/constants/__init__.py index 547204cf0714..dcfb865156b7 100644 --- a/scipy/constants/__init__.py +++ b/scipy/constants/__init__.py @@ -1,4 +1,287 @@ -from info import __doc__ +""" +================================== +Constants (:mod:`scipy.constants`) +================================== + +.. module:: scipy.constants + +Physical and mathematical constants and units. + + +Mathematical constants +====================== + +============ ================================================================= +``pi`` Pi +``golden`` Golden ratio +============ ================================================================= + + +Physical constants +================== + +============= ================================================================= +``c`` speed of light in vacuum +``mu_0`` the magnetic constant :math:`\mu_0` +``epsilon_0`` the electric constant (vacuum permittivity), :math:`\epsilon_0` +``h`` the Planck constant :math:`h` +``hbar`` :math:`\hbar = h/(2\pi)` +``G`` Newtonian constant of gravitation +``g`` standard acceleration of gravity +``e`` elementary charge +``R`` molar gas constant +``alpha`` fine-structure constant +``N_A`` Avogadro constant +``k`` Boltzmann constant +``sigma`` Stefan-Boltzmann constant :math:`\sigma` +``Wien`` Wien displacement law constant +``Rydberg`` Rydberg constant +``m_e`` electron mass +``m_p`` proton mass +``m_n`` neutron mass +============= ================================================================= + + +Constants database +------------------ + +In addition to the above variables, :mod:`scipy.constants` also contains the +2010 CODATA recommended values [CODATA2010]_ database containing more physical +constants. + +.. autosummary:: + :toctree: generated/ + + value -- Value in physical_constants indexed by key + unit -- Unit in physical_constants indexed by key + precision -- Relative precision in physical_constants indexed by key + find -- Return list of physical_constant keys with a given string + ConstantWarning -- Constant sought not in newest CODATA data set + +.. data:: physical_constants + + Dictionary of physical constants, of the format + ``physical_constants[name] = (value, unit, uncertainty)``. + +Available constants: + +====================================================================== ==== +%(constant_names)s +====================================================================== ==== + + +Units +===== + +SI prefixes +----------- + +============ ================================================================= +``yotta`` :math:`10^{24}` +``zetta`` :math:`10^{21}` +``exa`` :math:`10^{18}` +``peta`` :math:`10^{15}` +``tera`` :math:`10^{12}` +``giga`` :math:`10^{9}` +``mega`` :math:`10^{6}` +``kilo`` :math:`10^{3}` +``hecto`` :math:`10^{2}` +``deka`` :math:`10^{1}` +``deci`` :math:`10^{-1}` +``centi`` :math:`10^{-2}` +``milli`` :math:`10^{-3}` +``micro`` :math:`10^{-6}` +``nano`` :math:`10^{-9}` +``pico`` :math:`10^{-12}` +``femto`` :math:`10^{-15}` +``atto`` :math:`10^{-18}` +``zepto`` :math:`10^{-21}` +============ ================================================================= + +Binary prefixes +--------------- + +============ ================================================================= +``kibi`` :math:`2^{10}` +``mebi`` :math:`2^{20}` +``gibi`` :math:`2^{30}` +``tebi`` :math:`2^{40}` +``pebi`` :math:`2^{50}` +``exbi`` :math:`2^{60}` +``zebi`` :math:`2^{70}` +``yobi`` :math:`2^{80}` +============ ================================================================= + +Weight +------ + +================= ============================================================ +``gram`` :math:`10^{-3}` kg +``metric_ton`` :math:`10^{3}` kg +``grain`` one grain in kg +``lb`` one pound (avoirdupous) in kg +``oz`` one ounce in kg +``stone`` one stone in kg +``grain`` one grain in kg +``long_ton`` one long ton in kg +``short_ton`` one short ton in kg +``troy_ounce`` one Troy ounce in kg +``troy_pound`` one Troy pound in kg +``carat`` one carat in kg +``m_u`` atomic mass constant (in kg) +================= ============================================================ + +Angle +----- + +================= ============================================================ +``degree`` degree in radians +``arcmin`` arc minute in radians +``arcsec`` arc second in radians +================= ============================================================ + + +Time +---- + +================= ============================================================ +``minute`` one minute in seconds +``hour`` one hour in seconds +``day`` one day in seconds +``week`` one week in seconds +``year`` one year (365 days) in seconds +``Julian_year`` one Julian year (365.25 days) in seconds +================= ============================================================ + + +Length +------ + +================= ============================================================ +``inch`` one inch in meters +``foot`` one foot in meters +``yard`` one yard in meters +``mile`` one mile in meters +``mil`` one mil in meters +``pt`` one point in meters +``survey_foot`` one survey foot in meters +``survey_mile`` one survey mile in meters +``nautical_mile`` one nautical mile in meters +``fermi`` one Fermi in meters +``angstrom`` one Angstrom in meters +``micron`` one micron in meters +``au`` one astronomical unit in meters +``light_year`` one light year in meters +``parsec`` one parsec in meters +================= ============================================================ + +Pressure +-------- + +================= ============================================================ +``atm`` standard atmosphere in pascals +``bar`` one bar in pascals +``torr`` one torr (mmHg) in pascals +``psi`` one psi in pascals +================= ============================================================ + +Area +---- + +================= ============================================================ +``hectare`` one hectare in square meters +``acre`` one acre in square meters +================= ============================================================ + + +Volume +------ + +=================== ======================================================== +``liter`` one liter in cubic meters +``gallon`` one gallon (US) in cubic meters +``gallon_imp`` one gallon (UK) in cubic meters +``fluid_ounce`` one fluid ounce (US) in cubic meters +``fluid_ounce_imp`` one fluid ounce (UK) in cubic meters +``bbl`` one barrel in cubic meters +=================== ======================================================== + +Speed +----- + +================= ========================================================== +``kmh`` kilometers per hour in meters per second +``mph`` miles per hour in meters per second +``mach`` one Mach (approx., at 15 C, 1 atm) in meters per second +``knot`` one knot in meters per second +================= ========================================================== + + +Temperature +----------- + +===================== ======================================================= +``zero_Celsius`` zero of Celsius scale in Kelvin +``degree_Fahrenheit`` one Fahrenheit (only differences) in Kelvins +===================== ======================================================= + +.. autosummary:: + :toctree: generated/ + + C2K + K2C + F2C + C2F + F2K + K2F + +Energy +------ + +==================== ======================================================= +``eV`` one electron volt in Joules +``calorie`` one calorie (thermochemical) in Joules +``calorie_IT`` one calorie (International Steam Table calorie, 1956) in Joules +``erg`` one erg in Joules +``Btu`` one British thermal unit (International Steam Table) in Joules +``Btu_th`` one British thermal unit (thermochemical) in Joules +``ton_TNT`` one ton of TNT in Joules +==================== ======================================================= + +Power +----- + +==================== ======================================================= +``hp`` one horsepower in watts +==================== ======================================================= + +Force +----- + +==================== ======================================================= +``dyn`` one dyne in newtons +``lbf`` one pound force in newtons +``kgf`` one kilogram force in newtons +==================== ======================================================= + +Optics +------ + +.. autosummary:: + :toctree: generated/ + + lambda2nu + nu2lambda + +References +========== + +.. [CODATA2010] CODATA Recommended Values of the Fundamental + Physical Constants 2010. + + http://physics.nist.gov/cuu/Constants/index.html + +""" # Modules contributed by BasSw (wegwerp@gmail.com) from codata import * diff --git a/scipy/constants/info.py b/scipy/constants/info.py deleted file mode 100644 index c25e5a60c0f4..000000000000 --- a/scipy/constants/info.py +++ /dev/null @@ -1,285 +0,0 @@ -""" -================================== -Constants (:mod:`scipy.constants`) -================================== - -.. module:: scipy.constants - -Physical and mathematical constants and units. - - -Mathematical constants -====================== - -============ ================================================================= -``pi`` Pi -``golden`` Golden ratio -============ ================================================================= - - -Physical constants -================== - -============= ================================================================= -``c`` speed of light in vacuum -``mu_0`` the magnetic constant :math:`\mu_0` -``epsilon_0`` the electric constant (vacuum permittivity), :math:`\epsilon_0` -``h`` the Planck constant :math:`h` -``hbar`` :math:`\hbar = h/(2\pi)` -``G`` Newtonian constant of gravitation -``g`` standard acceleration of gravity -``e`` elementary charge -``R`` molar gas constant -``alpha`` fine-structure constant -``N_A`` Avogadro constant -``k`` Boltzmann constant -``sigma`` Stefan-Boltzmann constant :math:`\sigma` -``Wien`` Wien displacement law constant -``Rydberg`` Rydberg constant -``m_e`` electron mass -``m_p`` proton mass -``m_n`` neutron mass -============= ================================================================= - - -Constants database ------------------- - -In addition to the above variables, :mod:`scipy.constants` also contains the -2010 CODATA recommended values [CODATA2010]_ database containing more physical -constants. - -.. autosummary:: - :toctree: generated/ - - value -- Value in physical_constants indexed by key - unit -- Unit in physical_constants indexed by key - precision -- Relative precision in physical_constants indexed by key - find -- Return list of physical_constant keys with a given string - ConstantWarning -- Constant sought not in newest CODATA data set - -.. data:: physical_constants - - Dictionary of physical constants, of the format - ``physical_constants[name] = (value, unit, uncertainty)``. - -Available constants: - -====================================================================== ==== -%(constant_names)s -====================================================================== ==== - - -Units -===== - -SI prefixes ------------ - -============ ================================================================= -``yotta`` :math:`10^{24}` -``zetta`` :math:`10^{21}` -``exa`` :math:`10^{18}` -``peta`` :math:`10^{15}` -``tera`` :math:`10^{12}` -``giga`` :math:`10^{9}` -``mega`` :math:`10^{6}` -``kilo`` :math:`10^{3}` -``hecto`` :math:`10^{2}` -``deka`` :math:`10^{1}` -``deci`` :math:`10^{-1}` -``centi`` :math:`10^{-2}` -``milli`` :math:`10^{-3}` -``micro`` :math:`10^{-6}` -``nano`` :math:`10^{-9}` -``pico`` :math:`10^{-12}` -``femto`` :math:`10^{-15}` -``atto`` :math:`10^{-18}` -``zepto`` :math:`10^{-21}` -============ ================================================================= - -Binary prefixes ---------------- - -============ ================================================================= -``kibi`` :math:`2^{10}` -``mebi`` :math:`2^{20}` -``gibi`` :math:`2^{30}` -``tebi`` :math:`2^{40}` -``pebi`` :math:`2^{50}` -``exbi`` :math:`2^{60}` -``zebi`` :math:`2^{70}` -``yobi`` :math:`2^{80}` -============ ================================================================= - -Weight ------- - -================= ============================================================ -``gram`` :math:`10^{-3}` kg -``metric_ton`` :math:`10^{3}` kg -``grain`` one grain in kg -``lb`` one pound (avoirdupous) in kg -``oz`` one ounce in kg -``stone`` one stone in kg -``grain`` one grain in kg -``long_ton`` one long ton in kg -``short_ton`` one short ton in kg -``troy_ounce`` one Troy ounce in kg -``troy_pound`` one Troy pound in kg -``carat`` one carat in kg -``m_u`` atomic mass constant (in kg) -================= ============================================================ - -Angle ------ - -================= ============================================================ -``degree`` degree in radians -``arcmin`` arc minute in radians -``arcsec`` arc second in radians -================= ============================================================ - - -Time ----- - -================= ============================================================ -``minute`` one minute in seconds -``hour`` one hour in seconds -``day`` one day in seconds -``week`` one week in seconds -``year`` one year (365 days) in seconds -``Julian_year`` one Julian year (365.25 days) in seconds -================= ============================================================ - - -Length ------- - -================= ============================================================ -``inch`` one inch in meters -``foot`` one foot in meters -``yard`` one yard in meters -``mile`` one mile in meters -``mil`` one mil in meters -``pt`` one point in meters -``survey_foot`` one survey foot in meters -``survey_mile`` one survey mile in meters -``nautical_mile`` one nautical mile in meters -``fermi`` one Fermi in meters -``angstrom`` one Angstrom in meters -``micron`` one micron in meters -``au`` one astronomical unit in meters -``light_year`` one light year in meters -``parsec`` one parsec in meters -================= ============================================================ - -Pressure --------- - -================= ============================================================ -``atm`` standard atmosphere in pascals -``bar`` one bar in pascals -``torr`` one torr (mmHg) in pascals -``psi`` one psi in pascals -================= ============================================================ - -Area ----- - -================= ============================================================ -``hectare`` one hectare in square meters -``acre`` one acre in square meters -================= ============================================================ - - -Volume ------- - -=================== ======================================================== -``liter`` one liter in cubic meters -``gallon`` one gallon (US) in cubic meters -``gallon_imp`` one gallon (UK) in cubic meters -``fluid_ounce`` one fluid ounce (US) in cubic meters -``fluid_ounce_imp`` one fluid ounce (UK) in cubic meters -``bbl`` one barrel in cubic meters -=================== ======================================================== - -Speed ------ - -================= ========================================================== -``kmh`` kilometers per hour in meters per second -``mph`` miles per hour in meters per second -``mach`` one Mach (approx., at 15 C, 1 atm) in meters per second -``knot`` one knot in meters per second -================= ========================================================== - - -Temperature ------------ - -===================== ======================================================= -``zero_Celsius`` zero of Celsius scale in Kelvin -``degree_Fahrenheit`` one Fahrenheit (only differences) in Kelvins -===================== ======================================================= - -.. autosummary:: - :toctree: generated/ - - C2K - K2C - F2C - C2F - F2K - K2F - -Energy ------- - -==================== ======================================================= -``eV`` one electron volt in Joules -``calorie`` one calorie (thermochemical) in Joules -``calorie_IT`` one calorie (International Steam Table calorie, 1956) in Joules -``erg`` one erg in Joules -``Btu`` one British thermal unit (International Steam Table) in Joules -``Btu_th`` one British thermal unit (thermochemical) in Joules -``ton_TNT`` one ton of TNT in Joules -==================== ======================================================= - -Power ------ - -==================== ======================================================= -``hp`` one horsepower in watts -==================== ======================================================= - -Force ------ - -==================== ======================================================= -``dyn`` one dyne in newtons -``lbf`` one pound force in newtons -``kgf`` one kilogram force in newtons -==================== ======================================================= - -Optics ------- - -.. autosummary:: - :toctree: generated/ - - lambda2nu - nu2lambda - -References -========== - -.. [CODATA2010] CODATA Recommended Values of the Fundamental - Physical Constants 2010. - - http://physics.nist.gov/cuu/Constants/index.html - -""" - diff --git a/scipy/fftpack/__init__.py b/scipy/fftpack/__init__.py index 11bb1c389036..2731bee84825 100644 --- a/scipy/fftpack/__init__.py +++ b/scipy/fftpack/__init__.py @@ -1,9 +1,94 @@ -# -# fftpack - Discrete Fourier Transform algorithms. -# -# Created: Pearu Peterson, August,September 2002 +""" +================================================== +Discrete Fourier transforms (:mod:`scipy.fftpack`) +================================================== -from info import __all__,__doc__ +Fast Fourier Transforms (FFTs) +============================== + +.. autosummary:: + :toctree: generated/ + + fft - Fast (discrete) Fourier Transform (FFT) + ifft - Inverse FFT + fft2 - Two dimensional FFT + ifft2 - Two dimensional inverse FFT + fftn - n-dimensional FFT + ifftn - n-dimensional inverse FFT + rfft - FFT of strictly real-valued sequence + irfft - Inverse of rfft + dct - Discrete cosine transform + idct - Inverse discrete cosine transform + +Differential and pseudo-differential operators +============================================== + +.. autosummary:: + :toctree: generated/ + + diff - Differentiation and integration of periodic sequences + tilbert - Tilbert transform: cs_diff(x,h,h) + itilbert - Inverse Tilbert transform: sc_diff(x,h,h) + hilbert - Hilbert transform: cs_diff(x,inf,inf) + ihilbert - Inverse Hilbert transform: sc_diff(x,inf,inf) + cs_diff - cosh/sinh pseudo-derivative of periodic sequences + sc_diff - sinh/cosh pseudo-derivative of periodic sequences + ss_diff - sinh/sinh pseudo-derivative of periodic sequences + cc_diff - cosh/cosh pseudo-derivative of periodic sequences + shift - Shift periodic sequences + +Helper functions +================ + +.. autosummary:: + :toctree: generated/ + + fftshift - Shift the zero-frequency component to the center of the spectrum + ifftshift - The inverse of `fftshift` + fftfreq - Return the Discrete Fourier Transform sample frequencies + rfftfreq - DFT sample frequencies (for usage with rfft, irfft) + + +Convolutions (:mod:`scipy.fftpack.convolve`) +============================================ + +.. module:: scipy.fftpack.convolve + +.. autosummary:: + :toctree: generated/ + + convolve + convolve_z + init_convolution_kernel + destroy_convolve_cache + + +Other (:mod:`scipy.fftpack._fftpack`) +===================================== + +.. module:: scipy.fftpack._fftpack + +.. autosummary:: + :toctree: generated/ + + drfft + zfft + zrfft + zfftnd + destroy_drfft_cache + destroy_zfft_cache + destroy_zfftnd_cache + +""" + +__all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', + 'fft2','ifft2', + 'diff', + 'tilbert','itilbert','hilbert','ihilbert', + 'sc_diff','cs_diff','cc_diff','ss_diff', + 'shift', + 'rfftfreq' + ] from fftpack_version import fftpack_version as __version__ diff --git a/scipy/fftpack/info.py b/scipy/fftpack/info.py deleted file mode 100644 index f6ed0bcb757d..000000000000 --- a/scipy/fftpack/info.py +++ /dev/null @@ -1,102 +0,0 @@ -# This file is executed by __init__.py. -""" -================================================== -Discrete Fourier transforms (:mod:`scipy.fftpack`) -================================================== - -Fast Fourier Transforms (FFTs) -============================== - -.. autosummary:: - :toctree: generated/ - - fft - Fast (discrete) Fourier Transform (FFT) - ifft - Inverse FFT - fft2 - Two dimensional FFT - ifft2 - Two dimensional inverse FFT - fftn - n-dimensional FFT - ifftn - n-dimensional inverse FFT - rfft - FFT of strictly real-valued sequence - irfft - Inverse of rfft - dct - Discrete cosine transform - idct - Inverse discrete cosine transform - -Differential and pseudo-differential operators -============================================== - -.. autosummary:: - :toctree: generated/ - - diff - Differentiation and integration of periodic sequences - tilbert - Tilbert transform: cs_diff(x,h,h) - itilbert - Inverse Tilbert transform: sc_diff(x,h,h) - hilbert - Hilbert transform: cs_diff(x,inf,inf) - ihilbert - Inverse Hilbert transform: sc_diff(x,inf,inf) - cs_diff - cosh/sinh pseudo-derivative of periodic sequences - sc_diff - sinh/cosh pseudo-derivative of periodic sequences - ss_diff - sinh/sinh pseudo-derivative of periodic sequences - cc_diff - cosh/cosh pseudo-derivative of periodic sequences - shift - Shift periodic sequences - -Helper functions -================ - -.. autosummary:: - :toctree: generated/ - - fftshift - Shift the zero-frequency component to the center of the spectrum - ifftshift - The inverse of `fftshift` - fftfreq - Return the Discrete Fourier Transform sample frequencies - rfftfreq - DFT sample frequencies (for usage with rfft, irfft) - - -Convolutions (:mod:`scipy.fftpack.convolve`) -============================================ - -.. module:: scipy.fftpack.convolve - -.. autosummary:: - :toctree: generated/ - - convolve - convolve_z - init_convolution_kernel - destroy_convolve_cache - - -Other (:mod:`scipy.fftpack._fftpack`) -===================================== - -.. module:: scipy.fftpack._fftpack - -.. autosummary:: - :toctree: generated/ - - drfft - zfft - zrfft - zfftnd - destroy_drfft_cache - destroy_zfft_cache - destroy_zfftnd_cache - -""" - -__all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', - 'fft2','ifft2', - 'diff', - 'tilbert','itilbert','hilbert','ihilbert', - 'sc_diff','cs_diff','cc_diff','ss_diff', - 'shift', - 'rfftfreq' - ] - -if __doc__: - __doc_title__ = __doc__.lstrip().split('\n',1)[0] -else: - __doc_title__ = None - -postpone_import = 1 - -global_symbols = ['fft','fftn','fft2','ifft','ifft2','ifftn', - 'fftshift','ifftshift','fftfreq'] diff --git a/scipy/integrate/__init__.py b/scipy/integrate/__init__.py index deb12e60ccb3..38e50484341b 100644 --- a/scipy/integrate/__init__.py +++ b/scipy/integrate/__init__.py @@ -1,8 +1,51 @@ -# -# integrate - Integration routines -# +""" +============================================= +Integration and ODEs (:mod:`scipy.integrate`) +============================================= -from info import __doc__ +.. currentmodule:: scipy.integrate + +Integrating functions, given function object +============================================ + +.. autosummary:: + :toctree: generated/ + + quad -- General purpose integration. + dblquad -- General purpose double integration. + tplquad -- General purpose triple integration. + fixed_quad -- Integrate func(x) using Gaussian quadrature of order n. + quadrature -- Integrate with given tolerance using Gaussian quadrature. + romberg -- Integrate func using Romberg integration. + +Integrating functions, given fixed samples +========================================== + +.. autosummary:: + :toctree: generated/ + + trapz -- Use trapezoidal rule to compute integral from samples. + cumtrapz -- Use trapezoidal rule to cumulatively compute integral. + simps -- Use Simpson's rule to compute integral from samples. + romb -- Use Romberg Integration to compute integral from + -- (2**k + 1) evenly-spaced samples. + +.. seealso:: + + :mod:`scipy.special` for orthogonal polynomials (special) for Gaussian + quadrature roots and weights for other weighting factors and regions. + +Integrators of ODE systems +========================== + +.. autosummary:: + :toctree: generated/ + + odeint -- General integration of ordinary differential equations. + ode -- Integrate ODE using VODE and ZVODE routines. + complex_ode -- Convert a complex-valued ODE to real-valued and integrate. + +""" from quadrature import * from odepack import * diff --git a/scipy/integrate/info.py b/scipy/integrate/info.py deleted file mode 100644 index 0ab29e28654b..000000000000 --- a/scipy/integrate/info.py +++ /dev/null @@ -1,50 +0,0 @@ -""" -============================================= -Integration and ODEs (:mod:`scipy.integrate`) -============================================= - -.. currentmodule:: scipy.integrate - -Integrating functions, given function object -============================================ - -.. autosummary:: - :toctree: generated/ - - quad -- General purpose integration. - dblquad -- General purpose double integration. - tplquad -- General purpose triple integration. - fixed_quad -- Integrate func(x) using Gaussian quadrature of order n. - quadrature -- Integrate with given tolerance using Gaussian quadrature. - romberg -- Integrate func using Romberg integration. - -Integrating functions, given fixed samples -========================================== - -.. autosummary:: - :toctree: generated/ - - trapz -- Use trapezoidal rule to compute integral from samples. - cumtrapz -- Use trapezoidal rule to cumulatively compute integral. - simps -- Use Simpson's rule to compute integral from samples. - romb -- Use Romberg Integration to compute integral from - -- (2**k + 1) evenly-spaced samples. - -.. seealso:: - - :mod:`scipy.special` for orthogonal polynomials (special) for Gaussian - quadrature roots and weights for other weighting factors and regions. - -Integrators of ODE systems -========================== - -.. autosummary:: - :toctree: generated/ - - odeint -- General integration of ordinary differential equations. - ode -- Integrate ODE using VODE and ZVODE routines. - complex_ode -- Convert a complex-valued ODE to real-valued and integrate. - -""" - -postpone_import = 1 diff --git a/scipy/interpolate/__init__.py b/scipy/interpolate/__init__.py index 049603660a0a..6f9a75b95941 100644 --- a/scipy/interpolate/__init__.py +++ b/scipy/interpolate/__init__.py @@ -1,8 +1,147 @@ -# -# interpolate - Interpolation Tools -# +""" +======================================== +Interpolation (:mod:`scipy.interpolate`) +======================================== -from info import __doc__ +.. currentmodule:: scipy.interpolate + +Sub-package for objects used in interpolation. + +As listed below, this sub-package contains spline functions and classes, +one-dimensional and multi-dimensional (univariate and multivariate) +interpolation classes, Lagrange and Taylor polynomial interpolators, and +wrappers for `FITPACK `_ +and DFITPACK functions. + +Univariate interpolation +======================== + +.. autosummary:: + :toctree: generated/ + + interp1d + BarycentricInterpolator + KroghInterpolator + PiecewisePolynomial + barycentric_interpolate + krogh_interpolate + piecewise_polynomial_interpolate + + +Multivariate interpolation +========================== + +Unstructured data: + +.. autosummary:: + :toctree: generated/ + + griddata + LinearNDInterpolator + NearestNDInterpolator + CloughTocher2DInterpolator + Rbf + interp2d + +For data on a grid: + +.. autosummary:: + + RectBivariateSpline + +.. seealso:: `scipy.ndimage.map_coordinates` + + +1-D Splines +=========== + +.. autosummary:: + :toctree: generated/ + + UnivariateSpline + InterpolatedUnivariateSpline + LSQUnivariateSpline + +The above univariate spline classes have the following methods: + +.. autosummary:: + + UnivariateSpline.__call__ + UnivariateSpline.derivatives + UnivariateSpline.integral + UnivariateSpline.roots + UnivariateSpline.get_coeffs + UnivariateSpline.get_knots + UnivariateSpline.get_residual + UnivariateSpline.set_smoothing_factor + + +Low-level interface to FITPACK functions: + +.. autosummary:: + :toctree: generated/ + + splrep + splprep + splev + splint + sproot + spalde + bisplrep + bisplev + + +2-D Splines +=========== + +For data on a grid: + +.. autosummary:: + :toctree: generated/ + + RectBivariateSpline + +For unstructured data: + +.. autosummary:: + :toctree: generated/ + + BivariateSpline + SmoothBivariateSpline + LSQBivariateSpline + +Low-level interface to FITPACK functions: + +.. autosummary:: + :toctree: generated/ + + bisplrep + bisplev + +Additional tools +================ + +.. autosummary:: + :toctree: generated/ + + lagrange + approximate_taylor_polynomial + +.. seealso:: + + `scipy.ndimage.map_coordinates`, + `scipy.ndimage.spline_filter`, + `scipy.signal.resample`, + `scipy.signal.bspline`, + `scipy.signal.gauss_spline`, + `scipy.signal.qspline1d`, + `scipy.signal.cspline1d`, + `scipy.signal.qspline1d_eval`, + `scipy.signal.cspline1d_eval`, + `scipy.signal.qspline2d`, + `scipy.signal.cspline2d`. + +""" from interpolate import * from fitpack import * diff --git a/scipy/interpolate/info.py b/scipy/interpolate/info.py deleted file mode 100644 index 26c11561df39..000000000000 --- a/scipy/interpolate/info.py +++ /dev/null @@ -1,146 +0,0 @@ -""" -======================================== -Interpolation (:mod:`scipy.interpolate`) -======================================== - -.. currentmodule:: scipy.interpolate - -Sub-package for objects used in interpolation. - -As listed below, this sub-package contains spline functions and classes, -one-dimensional and multi-dimensional (univariate and multivariate) -interpolation classes, Lagrange and Taylor polynomial interpolators, and -wrappers for `FITPACK `_ -and DFITPACK functions. - -Univariate interpolation -======================== - -.. autosummary:: - :toctree: generated/ - - interp1d - BarycentricInterpolator - KroghInterpolator - PiecewisePolynomial - barycentric_interpolate - krogh_interpolate - piecewise_polynomial_interpolate - - -Multivariate interpolation -========================== - -Unstructured data: - -.. autosummary:: - :toctree: generated/ - - griddata - LinearNDInterpolator - NearestNDInterpolator - CloughTocher2DInterpolator - Rbf - interp2d - -For data on a grid: - -.. autosummary:: - - RectBivariateSpline - -.. seealso:: `scipy.ndimage.map_coordinates` - - -1-D Splines -=========== - -.. autosummary:: - :toctree: generated/ - - UnivariateSpline - InterpolatedUnivariateSpline - LSQUnivariateSpline - -The above univariate spline classes have the following methods: - -.. autosummary:: - - UnivariateSpline.__call__ - UnivariateSpline.derivatives - UnivariateSpline.integral - UnivariateSpline.roots - UnivariateSpline.get_coeffs - UnivariateSpline.get_knots - UnivariateSpline.get_residual - UnivariateSpline.set_smoothing_factor - - -Low-level interface to FITPACK functions: - -.. autosummary:: - :toctree: generated/ - - splrep - splprep - splev - splint - sproot - spalde - bisplrep - bisplev - - -2-D Splines -=========== - -For data on a grid: - -.. autosummary:: - :toctree: generated/ - - RectBivariateSpline - -For unstructured data: - -.. autosummary:: - :toctree: generated/ - - BivariateSpline - SmoothBivariateSpline - LSQBivariateSpline - -Low-level interface to FITPACK functions: - -.. autosummary:: - :toctree: generated/ - - bisplrep - bisplev - -Additional tools -================ - -.. autosummary:: - :toctree: generated/ - - lagrange - approximate_taylor_polynomial - -.. seealso:: - - `scipy.ndimage.map_coordinates`, - `scipy.ndimage.spline_filter`, - `scipy.signal.resample`, - `scipy.signal.bspline`, - `scipy.signal.gauss_spline`, - `scipy.signal.qspline1d`, - `scipy.signal.cspline1d`, - `scipy.signal.qspline1d_eval`, - `scipy.signal.cspline1d_eval`, - `scipy.signal.qspline2d`, - `scipy.signal.cspline2d`. - -""" - -postpone_import = 1 diff --git a/scipy/io/__init__.py b/scipy/io/__init__.py index 36e49bfc2443..4051c5fb400d 100644 --- a/scipy/io/__init__.py +++ b/scipy/io/__init__.py @@ -1,9 +1,76 @@ -# -# io - Data input and output -# +# -*- encoding:utf-8 -*- +""" +================================== +Input and output (:mod:`scipy.io`) +================================== -from info import __doc__ +.. currentmodule:: scipy.io +SciPy has many modules, classes, and functions available to read data +from and write data to a variety of file formats. + +.. seealso:: :ref:`numpy-reference.routines.io` (in Numpy) + +MATLABĀ® files +============= + +.. autosummary:: + :toctree: generated/ + + loadmat - Read a MATLAB style mat file (version 4 through 7.1) + savemat - Write a MATLAB style mat file (version 4 through 7.1) + +Matrix Market files +=================== + +.. autosummary:: + :toctree: generated/ + + mminfo - Query matrix info from Matrix Market formatted file + mmread - Read matrix from Matrix Market formatted file + mmwrite - Write matrix to Matrix Market formatted file + +Other +===== + +.. autosummary:: + :toctree: generated/ + + save_as_module - Data saved as module, accessed on load as attirbutes + +Wav sound files (:mod:`scipy.io.wavfile`) +========================================= + +.. module:: scipy.io.wavfile + +.. autosummary:: + :toctree: generated/ + + read + write + +Arff files (:mod:`scipy.io.arff`) +================================= + +.. module:: scipy.io.arff + +.. autosummary:: + :toctree: generated/ + + loadarff + +Netcdf (:mod:`scipy.io.netcdf`) +=============================== + +.. module:: scipy.io.netcdf + +.. autosummary:: + :toctree: generated/ + + netcdf_file - A file object for NetCDF data + netcdf_variable - A data object for the netcdf module + +""" from numpy import deprecate diff --git a/scipy/io/info.py b/scipy/io/info.py deleted file mode 100644 index 254ab8e647ed..000000000000 --- a/scipy/io/info.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- encoding:utf-8 -*- -u""" -================================== -Input and output (:mod:`scipy.io`) -================================== - -.. currentmodule:: scipy.io - -SciPy has many modules, classes, and functions available to read data -from and write data to a variety of file formats. - -.. seealso:: :ref:`numpy-reference.routines.io` (in Numpy) - -MATLABĀ® files -============= - -.. autosummary:: - :toctree: generated/ - - loadmat - Read a MATLAB style mat file (version 4 through 7.1) - savemat - Write a MATLAB style mat file (version 4 through 7.1) - -Matrix Market files -=================== - -.. autosummary:: - :toctree: generated/ - - mminfo - Query matrix info from Matrix Market formatted file - mmread - Read matrix from Matrix Market formatted file - mmwrite - Write matrix to Matrix Market formatted file - -Other -===== - -.. autosummary:: - :toctree: generated/ - - save_as_module - Data saved as module, accessed on load as attirbutes - -Wav sound files (:mod:`scipy.io.wavfile`) -========================================= - -.. module:: scipy.io.wavfile - -.. autosummary:: - :toctree: generated/ - - read - write - -Arff files (:mod:`scipy.io.arff`) -================================= - -.. module:: scipy.io.arff - -.. autosummary:: - :toctree: generated/ - - loadarff - -Netcdf (:mod:`scipy.io.netcdf`) -=============================== - -.. module:: scipy.io.netcdf - -.. autosummary:: - :toctree: generated/ - - netcdf_file - A file object for NetCDF data - netcdf_variable - A data object for the netcdf module - -""" -postpone_import = 1 diff --git a/scipy/lib/__init__.py b/scipy/lib/__init__.py index bce74d2b8dd2..88e651259cd6 100644 --- a/scipy/lib/__init__.py +++ b/scipy/lib/__init__.py @@ -1,5 +1,13 @@ +""" +Python wrappers to external libraries +===================================== -from info import __doc__, __all__ + lapack -- wrappers for LAPACK/ATLAS libraries + blas -- wrappers for BLAS/ATLAS libraries + +""" + +__all__ = ['lapack','blas'] from numpy.testing import Tester test = Tester().test diff --git a/scipy/lib/info.py b/scipy/lib/info.py deleted file mode 100644 index 4e81f2615837..000000000000 --- a/scipy/lib/info.py +++ /dev/null @@ -1,10 +0,0 @@ -""" -Python wrappers to external libraries -===================================== - - lapack -- wrappers for LAPACK/ATLAS libraries - blas -- wrappers for BLAS/ATLAS libraries - -""" - -__all__ = ['lapack','blas'] diff --git a/scipy/linalg/__init__.py b/scipy/linalg/__init__.py index 65cd348d209e..a94f748457b8 100644 --- a/scipy/linalg/__init__.py +++ b/scipy/linalg/__init__.py @@ -1,8 +1,115 @@ -# -# linalg - Dense Linear Algebra routines -# +""" +==================================== +Linear algebra (:mod:`scipy.linalg`) +==================================== + +.. currentmodule:: scipy.linalg + +Linear algebra functions. + +.. seealso:: + + `numpy.linalg` for more linear algebra functions. Note that + although `scipy.linalg` imports most of them, identically named + functions from `scipy.linalg` may offer more or slightly differing + functionality. + + +Basics +====== + +.. autosummary:: + :toctree: generated/ + + inv - Find the inverse of a square matrix + solve - Solve a linear system of equations + solve_banded - Solve a banded linear system + solveh_banded - Solve a Hermitian or symmetric banded system + solve_triangular - Solve a triangular matrix + det - Find the determinant of a square matrix + norm - Matrix and vector norm + lstsq - Solve a linear least-squares problem + pinv - Pseudo-inverse (Moore-Penrose) using lstsq + pinv2 - Pseudo-inverse using svd + kron - Kronecker product of two arrays + tril - Construct a lower-triangular matrix from a given matrix + triu - Construct an upper-triangular matrix from a given matrix + +Eigenvalue Problems +=================== + +.. autosummary:: + :toctree: generated/ + + eig - Find the eigenvalues and eigenvectors of a square matrix + eigvals - Find just the eigenvalues of a square matrix + eigh - Find the e-vals and e-vectors of a Hermitian or symmetric matrix + eigvalsh - Find just the eigenvalues of a Hermitian or symmetric matrix + eig_banded - Find the eigenvalues and eigenvectors of a banded matrix + eigvals_banded - Find just the eigenvalues of a banded matrix + +Decompositions +============== + +.. autosummary:: + :toctree: generated/ + + lu - LU decomposition of a matrix + lu_factor - LU decomposition returning unordered matrix and pivots + lu_solve - Solve Ax=b using back substitution with output of lu_factor + svd - Singular value decomposition of a matrix + svdvals - Singular values of a matrix + diagsvd - Construct matrix of singular values from output of svd + orth - Construct orthonormal basis for the range of A using svd + cholesky - Cholesky decomposition of a matrix + cholesky_banded - Cholesky decomp. of a sym. or Hermitian banded matrix + cho_factor - Cholesky decomposition for use in solving a linear system + cho_solve - Solve previously factored linear system + cho_solve_banded - Solve previously factored banded linear system + qr - QR decomposition of a matrix + schur - Schur decomposition of a matrix + rsf2csf - Real to complex Schur form + hessenberg - Hessenberg form of a matrix + +Matrix Functions +================ + +.. autosummary:: + :toctree: generated/ + + expm - Matrix exponential using Pade approximation + expm2 - Matrix exponential using eigenvalue decomposition + expm3 - Matrix exponential using Taylor-series expansion + logm - Matrix logarithm + cosm - Matrix cosine + sinm - Matrix sine + tanm - Matrix tangent + coshm - Matrix hyperbolic cosine + sinhm - Matrix hyperbolic sine + tanhm - Matrix hyperbolic tangent + signm - Matrix sign + sqrtm - Matrix square root + funm - Evaluating an arbitrary matrix function + +Special Matrices +================ + +.. autosummary:: + :toctree: generated/ + + block_diag - Construct a block diagonal matrix from submatrices + circulant - Circulant matrix + companion - Companion matrix + hadamard - Hadamard matrix of order 2**n + hankel - Hankel matrix + hilbert - Hilbert matrix + invhilbert - Inverse Hilbert matrix + leslie - Leslie matrix + toeplitz - Toeplitz matrix + tri - Construct a matrix filled with ones at and below a given diagonal + +""" -from info import __doc__ from linalg_version import linalg_version as __version__ from misc import * diff --git a/scipy/linalg/info.py b/scipy/linalg/info.py deleted file mode 100644 index 11b08a415376..000000000000 --- a/scipy/linalg/info.py +++ /dev/null @@ -1,114 +0,0 @@ -""" -==================================== -Linear algebra (:mod:`scipy.linalg`) -==================================== - -.. currentmodule:: scipy.linalg - -Linear algebra functions. - -.. seealso:: - - `numpy.linalg` for more linear algebra functions. Note that - although `scipy.linalg` imports most of them, identically named - functions from `scipy.linalg` may offer more or slightly differing - functionality. - - -Basics -====== - -.. autosummary:: - :toctree: generated/ - - inv - Find the inverse of a square matrix - solve - Solve a linear system of equations - solve_banded - Solve a banded linear system - solveh_banded - Solve a Hermitian or symmetric banded system - solve_triangular - Solve a triangular matrix - det - Find the determinant of a square matrix - norm - Matrix and vector norm - lstsq - Solve a linear least-squares problem - pinv - Pseudo-inverse (Moore-Penrose) using lstsq - pinv2 - Pseudo-inverse using svd - kron - Kronecker product of two arrays - tril - Construct a lower-triangular matrix from a given matrix - triu - Construct an upper-triangular matrix from a given matrix - -Eigenvalue Problems -=================== - -.. autosummary:: - :toctree: generated/ - - eig - Find the eigenvalues and eigenvectors of a square matrix - eigvals - Find just the eigenvalues of a square matrix - eigh - Find the e-vals and e-vectors of a Hermitian or symmetric matrix - eigvalsh - Find just the eigenvalues of a Hermitian or symmetric matrix - eig_banded - Find the eigenvalues and eigenvectors of a banded matrix - eigvals_banded - Find just the eigenvalues of a banded matrix - -Decompositions -============== - -.. autosummary:: - :toctree: generated/ - - lu - LU decomposition of a matrix - lu_factor - LU decomposition returning unordered matrix and pivots - lu_solve - Solve Ax=b using back substitution with output of lu_factor - svd - Singular value decomposition of a matrix - svdvals - Singular values of a matrix - diagsvd - Construct matrix of singular values from output of svd - orth - Construct orthonormal basis for the range of A using svd - cholesky - Cholesky decomposition of a matrix - cholesky_banded - Cholesky decomp. of a sym. or Hermitian banded matrix - cho_factor - Cholesky decomposition for use in solving a linear system - cho_solve - Solve previously factored linear system - cho_solve_banded - Solve previously factored banded linear system - qr - QR decomposition of a matrix - schur - Schur decomposition of a matrix - rsf2csf - Real to complex Schur form - hessenberg - Hessenberg form of a matrix - -Matrix Functions -================ - -.. autosummary:: - :toctree: generated/ - - expm - Matrix exponential using Pade approximation - expm2 - Matrix exponential using eigenvalue decomposition - expm3 - Matrix exponential using Taylor-series expansion - logm - Matrix logarithm - cosm - Matrix cosine - sinm - Matrix sine - tanm - Matrix tangent - coshm - Matrix hyperbolic cosine - sinhm - Matrix hyperbolic sine - tanhm - Matrix hyperbolic tangent - signm - Matrix sign - sqrtm - Matrix square root - funm - Evaluating an arbitrary matrix function - -Special Matrices -================ - -.. autosummary:: - :toctree: generated/ - - block_diag - Construct a block diagonal matrix from submatrices - circulant - Circulant matrix - companion - Companion matrix - hadamard - Hadamard matrix of order 2**n - hankel - Hankel matrix - hilbert - Hilbert matrix - invhilbert - Inverse Hilbert matrix - leslie - Leslie matrix - toeplitz - Toeplitz matrix - tri - Construct a matrix filled with ones at and below a given diagonal - -""" - -postpone_import = 1 -depends = ['misc','lib.lapack'] diff --git a/scipy/misc/__init__.py b/scipy/misc/__init__.py index d5d402baa4ab..1358bf4b6deb 100644 --- a/scipy/misc/__init__.py +++ b/scipy/misc/__init__.py @@ -1,4 +1,40 @@ -from info import __doc__ +""" +========================================== +Miscellaneous routines (:mod:`scipy.misc`) +========================================== + +.. currentmodule:: scipy.misc + +Various utilities that don't have another home. + +Note that the Python Imaging Library (PIL) is not a dependency +of SciPy and therefore the `pilutil` module is not available on +systems that don't have PIL installed. + +.. autosummary:: + :toctree: generated/ + + bytescale - Byte scales an array (image) + central_diff_weights - Weights for an n-point central m-th derivative + comb - Combinations of N things taken k at a time, "N choose k" + derivative -\tFind the n-th derivative of a function at a point + factorial - The factorial function, n! = special.gamma(n+1) + factorial2 - Double factorial, (n!)! + factorialk - (...((n!)!)!...)! where there are k '!' + fromimage - Return a copy of a PIL image as a numpy array + imfilter - Simple filtering of an image + imread - Read an image file from a filename + imresize - Resize an image + imrotate - Rotate an image counter-clockwise + imsave - Save an array to an image file + imshow - Simple showing of an image through an external viewer + info - Get help information for a function, class, or module + lena - Get classic image processing example image Lena + pade - Pade approximation to function as the ratio of two polynomials + radon - + toimage - Takes a numpy array and returns a PIL image + +""" __all__ = ['who', 'source', 'info', 'doccer'] diff --git a/scipy/misc/info.py b/scipy/misc/info.py deleted file mode 100644 index 2d344ffe4e4d..000000000000 --- a/scipy/misc/info.py +++ /dev/null @@ -1,40 +0,0 @@ -""" -========================================== -Miscellaneous routines (:mod:`scipy.misc`) -========================================== - -.. currentmodule:: scipy.misc - -Various utilities that don't have another home. - -Note that the Python Imaging Library (PIL) is not a dependency -of SciPy and therefore the `pilutil` module is not available on -systems that don't have PIL installed. - -.. autosummary:: - :toctree: generated/ - - bytescale - Byte scales an array (image) - central_diff_weights - Weights for an n-point central m-th derivative - comb - Combinations of N things taken k at a time, "N choose k" - derivative -\tFind the n-th derivative of a function at a point - factorial - The factorial function, n! = special.gamma(n+1) - factorial2 - Double factorial, (n!)! - factorialk - (...((n!)!)!...)! where there are k '!' - fromimage - Return a copy of a PIL image as a numpy array - imfilter - Simple filtering of an image - imread - Read an image file from a filename - imresize - Resize an image - imrotate - Rotate an image counter-clockwise - imsave - Save an array to an image file - imshow - Simple showing of an image through an external viewer - info - Get help information for a function, class, or module - lena - Get classic image processing example image Lena - pade - Pade approximation to function as the ratio of two polynomials - radon - - toimage - Takes a numpy array and returns a PIL image - -""" - -global_symbols = ['info','factorial','factorial2','factorialk','comb','who', - 'lena','central_diff_weights', 'derivative', 'pade', 'source'] diff --git a/scipy/ndimage/__init__.py b/scipy/ndimage/__init__.py index e60e7308cc0a..14b9183ca86a 100644 --- a/scipy/ndimage/__init__.py +++ b/scipy/ndimage/__init__.py @@ -1,3 +1,141 @@ +""" +========================================================= +Multi-dimensional image processing (:mod:`scipy.ndimage`) +========================================================= + +.. currentmodule:: scipy.ndimage + +This package contains various functions for multi-dimensional image +processing. + + +Filters :mod:`scipy.ndimage.filters` +==================================== + +.. module:: scipy.ndimage.filters + +.. autosummary:: + :toctree: generated/ + + convolve - Multi-dimensional convolution + convolve1d - 1-D convolution along the given axis + correlate - Multi-dimensional correlation + correlate1d - 1-D correlation along the given axis + gaussian_filter + gaussian_filter1d + gaussian_gradient_magnitude + gaussian_laplace + generic_filter - Multi-dimensional filter using a given function + generic_filter1d - 1-D generic filter along the given axis + generic_gradient_magnitude + generic_laplace + laplace - n-D Laplace filter based on approximate second derivatives + maximum_filter + maximum_filter1d + median_filter - Calculates a multi-dimensional median filter + minimum_filter + minimum_filter1d + percentile_filter - Calculates a multi-dimensional percentile filter + prewitt + rank_filter - Calculates a multi-dimensional rank filter + sobel + uniform_filter - Multi-dimensional uniform filter + uniform_filter1d - 1-D uniform filter along the given axis + +Fourier filters :mod:`scipy.ndimage.fourier` +============================================ + +.. module:: scipy.ndimage.fourier + +.. autosummary:: + :toctree: generated/ + + fourier_ellipsoid + fourier_gaussian + fourier_shift + fourier_uniform + +Interpolation :mod:`scipy.ndimage.interpolation` +================================================ + +.. module:: scipy.ndimage.interpolation + +.. autosummary:: + :toctree: generated/ + + affine_transform - Apply an affine transformation + geometric_transform - Apply an arbritrary geometric transform + map_coordinates - Map input array to new coordinates by interpolation + rotate - Rotate an array + shift - Shift an array + spline_filter + spline_filter1d + zoom - Zoom an array + +Measurements :mod:`scipy.ndimage.measurements` +============================================== + +.. module:: scipy.ndimage.measurements + +.. autosummary:: + :toctree: generated/ + + center_of_mass - The center of mass of the values of an array at labels + extrema - Min's and max's of an array at labels, with their positions + find_objects - Find objects in a labeled array + histogram - Histogram of the values of an array, optionally at labels + label - Label features in an array + maximum + maximum_position + mean - Mean of the values of an array at labels + minimum + minimum_position + standard_deviation - Standard deviation of an n-D image array + sum - Sum of the values of the array + variance - Variance of the values of an n-D image array + watershed_ift + +Morphology :mod:`scipy.ndimage.morphology` +========================================== + +.. module:: scipy.ndimage.morphology + +.. autosummary:: + :toctree: generated/ + + binary_closing + binary_dilation + binary_erosion + binary_fill_holes + binary_hit_or_miss + binary_opening + binary_propagation + black_tophat + distance_transform_bf + distance_transform_cdt + distance_transform_edt + generate_binary_structure + grey_closing + grey_dilation + grey_erosion + grey_opening + iterate_structure + morphological_gradient + morphological_laplace + white_tophat + +Utility +======= + +.. currentmodule:: scipy.ndimage + +.. autosummary:: + :toctree: generated/ + + imread - Load an image from a file + +""" + # Copyright (C) 2003-2005 Peter J. Verveer # # Redistribution and use in source and binary forms, with or without diff --git a/scipy/ndimage/info.py b/scipy/ndimage/info.py deleted file mode 100644 index 6fc17ffa9240..000000000000 --- a/scipy/ndimage/info.py +++ /dev/null @@ -1,140 +0,0 @@ -""" -========================================================= -Multi-dimensional image processing (:mod:`scipy.ndimage`) -========================================================= - -.. currentmodule:: scipy.ndimage - -This package contains various functions for multi-dimensional image -processing. - - -Filters :mod:`scipy.ndimage.filters` -==================================== - -.. module:: scipy.ndimage.filters - -.. autosummary:: - :toctree: generated/ - - convolve - Multi-dimensional convolution - convolve1d - 1-D convolution along the given axis - correlate - Multi-dimensional correlation - correlate1d - 1-D correlation along the given axis - gaussian_filter - gaussian_filter1d - gaussian_gradient_magnitude - gaussian_laplace - generic_filter - Multi-dimensional filter using a given function - generic_filter1d - 1-D generic filter along the given axis - generic_gradient_magnitude - generic_laplace - laplace - n-D Laplace filter based on approximate second derivatives - maximum_filter - maximum_filter1d - median_filter - Calculates a multi-dimensional median filter - minimum_filter - minimum_filter1d - percentile_filter - Calculates a multi-dimensional percentile filter - prewitt - rank_filter - Calculates a multi-dimensional rank filter - sobel - uniform_filter - Multi-dimensional uniform filter - uniform_filter1d - 1-D uniform filter along the given axis - -Fourier filters :mod:`scipy.ndimage.fourier` -============================================ - -.. module:: scipy.ndimage.fourier - -.. autosummary:: - :toctree: generated/ - - fourier_ellipsoid - fourier_gaussian - fourier_shift - fourier_uniform - -Interpolation :mod:`scipy.ndimage.interpolation` -================================================ - -.. module:: scipy.ndimage.interpolation - -.. autosummary:: - :toctree: generated/ - - affine_transform - Apply an affine transformation - geometric_transform - Apply an arbritrary geometric transform - map_coordinates - Map input array to new coordinates by interpolation - rotate - Rotate an array - shift - Shift an array - spline_filter - spline_filter1d - zoom - Zoom an array - -Measurements :mod:`scipy.ndimage.measurements` -============================================== - -.. module:: scipy.ndimage.measurements - -.. autosummary:: - :toctree: generated/ - - center_of_mass - The center of mass of the values of an array at labels - extrema - Min's and max's of an array at labels, with their positions - find_objects - Find objects in a labeled array - histogram - Histogram of the values of an array, optionally at labels - label - Label features in an array - maximum - maximum_position - mean - Mean of the values of an array at labels - minimum - minimum_position - standard_deviation - Standard deviation of an n-D image array - sum - Sum of the values of the array - variance - Variance of the values of an n-D image array - watershed_ift - -Morphology :mod:`scipy.ndimage.morphology` -========================================== - -.. module:: scipy.ndimage.morphology - -.. autosummary:: - :toctree: generated/ - - binary_closing - binary_dilation - binary_erosion - binary_fill_holes - binary_hit_or_miss - binary_opening - binary_propagation - black_tophat - distance_transform_bf - distance_transform_cdt - distance_transform_edt - generate_binary_structure - grey_closing - grey_dilation - grey_erosion - grey_opening - iterate_structure - morphological_gradient - morphological_laplace - white_tophat - -Utility -======= - -.. currentmodule:: scipy.ndimage - -.. autosummary:: - :toctree: generated/ - - imread - Load an image from a file - -""" - -postpone_import = 1 -depends = [] diff --git a/scipy/odr/__init__.py b/scipy/odr/__init__.py index 3b02f74265ce..c90e1e2f0fee 100644 --- a/scipy/odr/__init__.py +++ b/scipy/odr/__init__.py @@ -1,12 +1,83 @@ -# -# odr - Orthogonal Distance Regression -# +""" +================================================= +Orthogonal distance regression (:mod:`scipy.odr`) +================================================= -from info import __doc__ +.. currentmodule:: scipy.odr -__version__ = '0.7' -__author__ = 'Robert Kern ' -__date__ = '2006-09-21' +Package Content +=============== + +.. autosummary:: + :toctree: generated/ + + odr -- Perform orthogonal distance regression + + ODR -- Gathers all info & manages the main fitting routine. + Data -- Stores the data to fit. + Model -- Stores information about the function to be fit. + Output + RealData -- Weights as actual std. dev.s and/or covariances. + + odr_error + odr_stop + +Usage information +================= + +Introduction +------------ + +Why Orthogonal Distance Regression (ODR)? Sometimes one has +measurement errors in the explanatory (a.k.a., "independent") +variable(s), not just the response (a.k.a., "dependent") variable(s). +Ordinary Least Squares (OLS) fitting procedures treat the data for +explanatory variables as fixed, i.e., not subject to error of any kind. +Furthermore, OLS procedures require that the response variables be an +explicit function of the explanatory variables; sometimes making the +equation explicit is impractical and/or introduces errors. ODR can +handle both of these cases with ease, and can even reduce to the OLS +case if that is sufficient for the problem. + +ODRPACK is a FORTRAN-77 library for performing ODR with possibly +non-linear fitting functions. It uses a modified trust-region +Levenberg-Marquardt-type algorithm [1]_ to estimate the function +parameters. The fitting functions are provided by Python functions +operating on NumPy arrays. The required derivatives may be provided +by Python functions as well, or may be estimated numerically. ODRPACK +can do explicit or implicit ODR fits, or it can do OLS. Input and +output variables may be multi-dimensional. Weights can be provided to +account for different variances of the observations, and even +covariances between dimensions of the variables. + +odr provides two interfaces: a single function, and a set of +high-level classes that wrap that function; please refer to their +docstrings for more information. While the docstring of the function +odr does not have a full explanation of its arguments, the classes do, +and arguments of the same name usually have the same requirements. +Furthermore, the user is urged to at least skim the `ODRPACK User's +Guide `_ - +"Know Thy Algorithm." + +Use +--- + +See the docstrings of `odr.odrpack` and the functions and classes for +usage instructions. The ODRPACK User's Guide (linked above) is also +quite helpful. + +References +---------- +.. [1] P. T. Boggs and J. E. Rogers, "Orthogonal Distance Regression," + in "Statistical analysis of measurement error models and + applications: proceedings of the AMS-IMS-SIAM joint summer research + conference held June 10-16, 1989," Contemporary Mathematics, + vol. 112, pg. 186, 1990. + +""" +# version: 0.7 +# author: Robert Kern +# date: 2006-09-21 from odrpack import * from models import * diff --git a/scipy/odr/info.py b/scipy/odr/info.py deleted file mode 100644 index 5f9929d9a0ec..000000000000 --- a/scipy/odr/info.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -================================================= -Orthogonal distance regression (:mod:`scipy.odr`) -================================================= - -.. currentmodule:: scipy.odr - -Package Content -=============== - -.. autosummary:: - :toctree: generated/ - - odr -- Perform orthogonal distance regression - - ODR -- Gathers all info & manages the main fitting routine. - Data -- Stores the data to fit. - Model -- Stores information about the function to be fit. - Output - RealData -- Weights as actual std. dev.s and/or covariances. - - odr_error - odr_stop - -Usage information -================= - -Introduction ------------- - -Why Orthogonal Distance Regression (ODR)? Sometimes one has -measurement errors in the explanatory (a.k.a., "independent") -variable(s), not just the response (a.k.a., "dependent") variable(s). -Ordinary Least Squares (OLS) fitting procedures treat the data for -explanatory variables as fixed, i.e., not subject to error of any kind. -Furthermore, OLS procedures require that the response variables be an -explicit function of the explanatory variables; sometimes making the -equation explicit is impractical and/or introduces errors. ODR can -handle both of these cases with ease, and can even reduce to the OLS -case if that is sufficient for the problem. - -ODRPACK is a FORTRAN-77 library for performing ODR with possibly -non-linear fitting functions. It uses a modified trust-region -Levenberg-Marquardt-type algorithm [1]_ to estimate the function -parameters. The fitting functions are provided by Python functions -operating on NumPy arrays. The required derivatives may be provided -by Python functions as well, or may be estimated numerically. ODRPACK -can do explicit or implicit ODR fits, or it can do OLS. Input and -output variables may be multi-dimensional. Weights can be provided to -account for different variances of the observations, and even -covariances between dimensions of the variables. - -odr provides two interfaces: a single function, and a set of -high-level classes that wrap that function; please refer to their -docstrings for more information. While the docstring of the function -odr does not have a full explanation of its arguments, the classes do, -and arguments of the same name usually have the same requirements. -Furthermore, the user is urged to at least skim the `ODRPACK User's -Guide `_ - -"Know Thy Algorithm." - -Use ---- - -See the docstrings of `odr.odrpack` and the functions and classes for -usage instructions. The ODRPACK User's Guide (linked above) is also -quite helpful. - -References ----------- -.. [1] P. T. Boggs and J. E. Rogers, "Orthogonal Distance Regression," - in "Statistical analysis of measurement error models and - applications: proceedings of the AMS-IMS-SIAM joint summer research - conference held June 10-16, 1989," Contemporary Mathematics, - vol. 112, pg. 186, 1990. - -""" -postpone_import = 1 diff --git a/scipy/optimize/__init__.py b/scipy/optimize/__init__.py index f680f6427958..c0e59e9feab6 100644 --- a/scipy/optimize/__init__.py +++ b/scipy/optimize/__init__.py @@ -1,8 +1,129 @@ -# -# optimize - Optimization Tools -# +""" +===================================================== +Optimization and root finding (:mod:`scipy.optimize`) +===================================================== -from info import __doc__ +.. currentmodule:: scipy.optimize + +Optimization +============ + +General-purpose +--------------- + +.. autosummary:: + :toctree: generated/ + + fmin - Nelder-Mead Simplex algorithm + fmin_powell - Powell's (modified) level set method + fmin_cg - Non-linear (Polak-Ribiere) conjugate gradient algorithm + fmin_bfgs - Quasi-Newton method (Broydon-Fletcher-Goldfarb-Shanno) + fmin_ncg - Line-search Newton Conjugate Gradient + leastsq - Minimize the sum of squares of M equations in N unknowns + +Constrained (multivariate) +-------------------------- + +.. autosummary:: + :toctree: generated/ + + fmin_l_bfgs_b - Zhu, Byrd, and Nocedal's constrained optimizer + fmin_tnc - Truncated Newton code + fmin_cobyla - Constrained optimization by linear approximation + fmin_slsqp - Minimization using sequential least-squares programming + nnls - Linear least-squares problem with non-negativity constraint + +Global +------ + +.. autosummary:: + :toctree: generated/ + + anneal - Simulated annealing + brute - Brute force searching optimizer + +Scalar function minimizers +-------------------------- + +.. autosummary:: + :toctree: generated/ + + fminbound - Bounded minimization of a scalar function + brent - 1-D function minimization using Brent method + golden - 1-D function minimization using Golden Section method + bracket - Bracket a minimum, given two starting points + +Fitting +======= + +.. autosummary:: + :toctree: generated/ + + curve_fit -- Fit curve to a set of points + +Root finding +============ + +Scalar functions +---------------- + +.. autosummary:: + :toctree: generated/ + + brentq - quadratic interpolation Brent method + brenth - Brent method, modified by Harris with hyperbolic extrapolation + ridder - Ridder's method + bisect - Bisection method + newton - Secant method or Newton's method + +Fixed point finding: + +.. autosummary:: + :toctree: generated/ + + fixed_point - Single-variable fixed-point solver + +Multidimensional +---------------- + +General nonlinear solvers: + +.. autosummary:: + :toctree: generated/ + + fsolve - Non-linear multi-variable equation solver + broyden1 - Broyden's first method + broyden2 - Broyden's second method + +Large-scale nonlinear solvers: + +.. autosummary:: + :toctree: generated/ + + newton_krylov + anderson + +Simple iterations: + +.. autosummary:: + :toctree: generated/ + + excitingmixing + linearmixing + diagbroyden + +:mod:`Additional information on the nonlinear solvers ` + +Utility Functions +================= + +.. autosummary:: + :toctree: generated/ + + line_search - Return a step that satisfies the strong Wolfe conditions + check_grad - Check the supplied derivative using finite differences + +""" from optimize import * from minpack import * diff --git a/scipy/optimize/info.py b/scipy/optimize/info.py deleted file mode 100644 index c51d5767753e..000000000000 --- a/scipy/optimize/info.py +++ /dev/null @@ -1,128 +0,0 @@ -""" -===================================================== -Optimization and root finding (:mod:`scipy.optimize`) -===================================================== - -.. currentmodule:: scipy.optimize - -Optimization -============ - -General-purpose ---------------- - -.. autosummary:: - :toctree: generated/ - - fmin - Nelder-Mead Simplex algorithm - fmin_powell - Powell's (modified) level set method - fmin_cg - Non-linear (Polak-Ribiere) conjugate gradient algorithm - fmin_bfgs - Quasi-Newton method (Broydon-Fletcher-Goldfarb-Shanno) - fmin_ncg - Line-search Newton Conjugate Gradient - leastsq - Minimize the sum of squares of M equations in N unknowns - -Constrained (multivariate) --------------------------- - -.. autosummary:: - :toctree: generated/ - - fmin_l_bfgs_b - Zhu, Byrd, and Nocedal's constrained optimizer - fmin_tnc - Truncated Newton code - fmin_cobyla - Constrained optimization by linear approximation - fmin_slsqp - Minimization using sequential least-squares programming - nnls - Linear least-squares problem with non-negativity constraint - -Global ------- - -.. autosummary:: - :toctree: generated/ - - anneal - Simulated annealing - brute - Brute force searching optimizer - -Scalar function minimizers --------------------------- - -.. autosummary:: - :toctree: generated/ - - fminbound - Bounded minimization of a scalar function - brent - 1-D function minimization using Brent method - golden - 1-D function minimization using Golden Section method - bracket - Bracket a minimum, given two starting points - -Fitting -======= - -.. autosummary:: - :toctree: generated/ - - curve_fit -- Fit curve to a set of points - -Root finding -============ - -Scalar functions ----------------- - -.. autosummary:: - :toctree: generated/ - - brentq - quadratic interpolation Brent method - brenth - Brent method, modified by Harris with hyperbolic extrapolation - ridder - Ridder's method - bisect - Bisection method - newton - Secant method or Newton's method - -Fixed point finding: - -.. autosummary:: - :toctree: generated/ - - fixed_point - Single-variable fixed-point solver - -Multidimensional ----------------- - -General nonlinear solvers: - -.. autosummary:: - :toctree: generated/ - - fsolve - Non-linear multi-variable equation solver - broyden1 - Broyden's first method - broyden2 - Broyden's second method - -Large-scale nonlinear solvers: - -.. autosummary:: - :toctree: generated/ - - newton_krylov - anderson - -Simple iterations: - -.. autosummary:: - :toctree: generated/ - - excitingmixing - linearmixing - diagbroyden - -:mod:`Additional information on the nonlinear solvers ` - -Utility Functions -================= - -.. autosummary:: - :toctree: generated/ - - line_search - Return a step that satisfies the strong Wolfe conditions - check_grad - Check the supplied derivative using finite differences - -""" - -postpone_import = 1 diff --git a/scipy/signal/__init__.py b/scipy/signal/__init__.py index 13e810afa620..5f5952f5900f 100644 --- a/scipy/signal/__init__.py +++ b/scipy/signal/__init__.py @@ -1,8 +1,187 @@ -# -# signal - Signal Processing Tools -# +""" +======================================= +Signal processing (:mod:`scipy.signal`) +======================================= -from info import __doc__ +.. module:: scipy.signal + +Convolution +=========== + +.. autosummary:: + :toctree: generated/ + + convolve -- N-dimensional convolution. + correlate -- N-dimensional correlation. + fftconvolve -- N-dimensional convolution using the FFT. + convolve2d -- 2-dimensional convolution (more options). + correlate2d -- 2-dimensional correlation (more options). + sepfir2d -- Convolve with a 2-D separable FIR filter. + +B-splines +========= + +.. autosummary:: + :toctree: generated/ + + bspline -- B-spline basis function of order n. + gauss_spline -- Gaussian approximation to the B-spline basis function. + cspline1d -- Coefficients for 1-D cubic (3rd order) B-spline. + qspline1d -- Coefficients for 1-D quadratic (2nd order) B-spline. + cspline2d -- Coefficients for 2-D cubic (3rd order) B-spline. + qspline2d -- Coefficients for 2-D quadratic (2nd order) B-spline. + spline_filter -- Smoothing spline (cubic) filtering of a rank-2 array. + +Filtering +========= + +.. autosummary:: + :toctree: generated/ + + order_filter -- N-dimensional order filter. + medfilt -- N-dimensional median filter. + medfilt2d -- 2-dimensional median filter (faster). + wiener -- N-dimensional wiener filter. + + symiirorder1 -- 2nd-order IIR filter (cascade of first-order systems). + symiirorder2 -- 4th-order IIR filter (cascade of second-order systems). + lfilter -- 1-dimensional FIR and IIR digital linear filtering. + lfiltic -- Construct initial conditions for `lfilter`. + lfilter_zi -- Compute an initial state zi for the lfilter function that + -- corresponds to the steady state of the step response. + filtfilt -- A forward-backward filter. + + deconvolve -- 1-d deconvolution using lfilter. + + hilbert -- Compute the analytic signal of a 1-d signal. + get_window -- Create FIR window. + + decimate -- Downsample a signal. + detrend -- Remove linear and/or constant trends from data. + resample -- Resample using Fourier method. + +Filter design +============= + +.. autosummary:: + :toctree: generated/ + + bilinear -- Digital filter from an analog filter using + -- the bilinear transform. + firwin -- Windowed FIR filter design, with frequency response + -- defined as pass and stop bands. + firwin2 -- Windowed FIR filter design, with arbitrary frequency + -- response. + freqs -- Analog filter frequency response. + freqz -- Digital filter frequency response. + iirdesign -- IIR filter design given bands and gains. + iirfilter -- IIR filter design given order and critical frequencies. + kaiser_atten -- Compute the attenuation of a Kaiser FIR filter, given + -- the number of taps and the transition width at + -- discontinuities in the frequency response. + kaiser_beta -- Compute the Kaiser parameter beta, given the desired + -- FIR filter attenuation. + kaiserord -- Design a Kaiser window to limit ripple and width of + -- transition region. + remez -- Optimal FIR filter design. + + unique_roots -- Unique roots and their multiplicities. + residue -- Partial fraction expansion of b(s) / a(s). + residuez -- Partial fraction expansion of b(z) / a(z). + invres -- Inverse partial fraction expansion. + +Matlab-style IIR filter design +============================== + +.. autosummary:: + :toctree: generated/ + + butter -- Butterworth + buttord + cheby1 -- Chebyshev Type I + cheb1ord + cheby2 -- Chebyshev Type II + cheb2ord + ellip -- Elliptic (Cauer) + ellipord + bessel -- Bessel (no order selection available -- try butterod) + +Linear Systems +============== + +.. autosummary:: + :toctree: generated/ + + lti -- linear time invariant system object. + lsim -- continuous-time simulation of output to linear system. + lsim2 -- like lsim, but `scipy.integrate.odeint` is used. + impulse -- impulse response of linear, time-invariant (LTI) system. + impulse2 -- like impulse, but `scipy.integrate.odeint` is used. + step -- step response of continous-time LTI system. + step2 -- like step, but `scipy.integrate.odeint` is used. + +LTI Representations +=================== + +.. autosummary:: + :toctree: generated/ + + tf2zpk -- transfer function to zero-pole-gain. + zpk2tf -- zero-pole-gain to transfer function. + tf2ss -- transfer function to state-space. + ss2tf -- state-pace to transfer function. + zpk2ss -- zero-pole-gain to state-space. + ss2zpk -- state-space to pole-zero-gain. + +Waveforms +========= + +.. autosummary:: + :toctree: generated/ + + chirp -- Frequency swept cosine signal, with several freq functions. + gausspulse -- Gaussian modulated sinusoid + sawtooth -- Periodic sawtooth + square -- Square wave + sweep_poly -- Frequency swept cosine signal; freq is arbitrary polynomial + +Window functions +================ + +.. autosummary:: + :toctree: generated/ + + get_window -- Return a window of a given length and type. + barthann -- Bartlett-Hann window + bartlett -- Bartlett window + blackman -- Blackman window + blackmanharris -- Minimum 4-term Blackman-Harris window + bohman -- Bohman window + boxcar -- Boxcar window + chebwin -- Dolph-Chebyshev window + flattop -- Flat top window + gaussian -- Gaussian window + general_gaussian -- Generalized Gaussian window + hamming -- Hamming window + hann -- Hann window + kaiser -- Kaiser window + nuttall -- Nuttall's minimum 4-term Blackman-Harris window + parzen -- Parzen window + slepian -- Slepian window + triang -- Triangular window + +Wavelets +======== + +.. autosummary:: + :toctree: generated/ + + cascade -- compute scaling function and wavelet from coefficients + daub -- return low-pass + morlet -- Complex Morlet wavelet. + qmf -- return quadrature mirror filter from low-pass + +""" import sigtools from waveforms import * diff --git a/scipy/signal/info.py b/scipy/signal/info.py deleted file mode 100644 index 48688cc9aab0..000000000000 --- a/scipy/signal/info.py +++ /dev/null @@ -1,186 +0,0 @@ -""" -======================================= -Signal processing (:mod:`scipy.signal`) -======================================= - -.. module:: scipy.signal - -Convolution -=========== - -.. autosummary:: - :toctree: generated/ - - convolve -- N-dimensional convolution. - correlate -- N-dimensional correlation. - fftconvolve -- N-dimensional convolution using the FFT. - convolve2d -- 2-dimensional convolution (more options). - correlate2d -- 2-dimensional correlation (more options). - sepfir2d -- Convolve with a 2-D separable FIR filter. - -B-splines -========= - -.. autosummary:: - :toctree: generated/ - - bspline -- B-spline basis function of order n. - gauss_spline -- Gaussian approximation to the B-spline basis function. - cspline1d -- Coefficients for 1-D cubic (3rd order) B-spline. - qspline1d -- Coefficients for 1-D quadratic (2nd order) B-spline. - cspline2d -- Coefficients for 2-D cubic (3rd order) B-spline. - qspline2d -- Coefficients for 2-D quadratic (2nd order) B-spline. - spline_filter -- Smoothing spline (cubic) filtering of a rank-2 array. - -Filtering -========= - -.. autosummary:: - :toctree: generated/ - - order_filter -- N-dimensional order filter. - medfilt -- N-dimensional median filter. - medfilt2d -- 2-dimensional median filter (faster). - wiener -- N-dimensional wiener filter. - - symiirorder1 -- 2nd-order IIR filter (cascade of first-order systems). - symiirorder2 -- 4th-order IIR filter (cascade of second-order systems). - lfilter -- 1-dimensional FIR and IIR digital linear filtering. - lfiltic -- Construct initial conditions for `lfilter`. - lfilter_zi -- Compute an initial state zi for the lfilter function that - -- corresponds to the steady state of the step response. - filtfilt -- A forward-backward filter. - - deconvolve -- 1-d deconvolution using lfilter. - - hilbert -- Compute the analytic signal of a 1-d signal. - get_window -- Create FIR window. - - decimate -- Downsample a signal. - detrend -- Remove linear and/or constant trends from data. - resample -- Resample using Fourier method. - -Filter design -============= - -.. autosummary:: - :toctree: generated/ - - bilinear -- Digital filter from an analog filter using - -- the bilinear transform. - firwin -- Windowed FIR filter design, with frequency response - -- defined as pass and stop bands. - firwin2 -- Windowed FIR filter design, with arbitrary frequency - -- response. - freqs -- Analog filter frequency response. - freqz -- Digital filter frequency response. - iirdesign -- IIR filter design given bands and gains. - iirfilter -- IIR filter design given order and critical frequencies. - kaiser_atten -- Compute the attenuation of a Kaiser FIR filter, given - -- the number of taps and the transition width at - -- discontinuities in the frequency response. - kaiser_beta -- Compute the Kaiser parameter beta, given the desired - -- FIR filter attenuation. - kaiserord -- Design a Kaiser window to limit ripple and width of - -- transition region. - remez -- Optimal FIR filter design. - - unique_roots -- Unique roots and their multiplicities. - residue -- Partial fraction expansion of b(s) / a(s). - residuez -- Partial fraction expansion of b(z) / a(z). - invres -- Inverse partial fraction expansion. - -Matlab-style IIR filter design -============================== - -.. autosummary:: - :toctree: generated/ - - butter -- Butterworth - buttord - cheby1 -- Chebyshev Type I - cheb1ord - cheby2 -- Chebyshev Type II - cheb2ord - ellip -- Elliptic (Cauer) - ellipord - bessel -- Bessel (no order selection available -- try butterod) - -Linear Systems -============== - -.. autosummary:: - :toctree: generated/ - - lti -- linear time invariant system object. - lsim -- continuous-time simulation of output to linear system. - lsim2 -- like lsim, but `scipy.integrate.odeint` is used. - impulse -- impulse response of linear, time-invariant (LTI) system. - impulse2 -- like impulse, but `scipy.integrate.odeint` is used. - step -- step response of continous-time LTI system. - step2 -- like step, but `scipy.integrate.odeint` is used. - -LTI Representations -=================== - -.. autosummary:: - :toctree: generated/ - - tf2zpk -- transfer function to zero-pole-gain. - zpk2tf -- zero-pole-gain to transfer function. - tf2ss -- transfer function to state-space. - ss2tf -- state-pace to transfer function. - zpk2ss -- zero-pole-gain to state-space. - ss2zpk -- state-space to pole-zero-gain. - -Waveforms -========= - -.. autosummary:: - :toctree: generated/ - - chirp -- Frequency swept cosine signal, with several freq functions. - gausspulse -- Gaussian modulated sinusoid - sawtooth -- Periodic sawtooth - square -- Square wave - sweep_poly -- Frequency swept cosine signal; freq is arbitrary polynomial - -Window functions -================ - -.. autosummary:: - :toctree: generated/ - - get_window -- Return a window of a given length and type. - barthann -- Bartlett-Hann window - bartlett -- Bartlett window - blackman -- Blackman window - blackmanharris -- Minimum 4-term Blackman-Harris window - bohman -- Bohman window - boxcar -- Boxcar window - chebwin -- Dolph-Chebyshev window - flattop -- Flat top window - gaussian -- Gaussian window - general_gaussian -- Generalized Gaussian window - hamming -- Hamming window - hann -- Hann window - kaiser -- Kaiser window - nuttall -- Nuttall's minimum 4-term Blackman-Harris window - parzen -- Parzen window - slepian -- Slepian window - triang -- Triangular window - -Wavelets -======== - -.. autosummary:: - :toctree: generated/ - - cascade -- compute scaling function and wavelet from coefficients - daub -- return low-pass - morlet -- Complex Morlet wavelet. - qmf -- return quadrature mirror filter from low-pass - -""" - -postpone_import = 1 diff --git a/scipy/sparse/__init__.py b/scipy/sparse/__init__.py index 7be66397efc1..e2ecb154bb8f 100644 --- a/scipy/sparse/__init__.py +++ b/scipy/sparse/__init__.py @@ -1,4 +1,175 @@ -from info import __doc__ +""" +===================================== +Sparse matrices (:mod:`scipy.sparse`) +===================================== + +.. currentmodule:: scipy.sparse + +SciPy 2-D sparse matrix package. + +Contents +======== + +Sparse matrix classes +--------------------- + +.. autosummary:: + :toctree: generated/ + + bsr_matrix - Block Sparse Row matrix + coo_matrix - A sparse matrix in COOrdinate format + csc_matrix - Compressed Sparse Column matrix + csr_matrix - Compressed Sparse Row matrix + dia_matrix - Sparse matrix with DIAgonal storage + dok_matrix - Dictionary Of Keys based sparse matrix + lil_matrix - Row-based linked list sparse matrix + +Functions +--------- + +Building sparse matrices: + +.. autosummary:: + :toctree: generated/ + + eye - Sparse MxN matrix whose k-th diagonal is all ones + identity - Identity matrix in sparse format + kron - kronecker product of two sparse matrices + kronsum - kronecker sum of sparse matrices + spdiags - Return a sparse matrix from diagonals + tril - Lower triangular portion of a matrix in sparse format + triu - Upper triangular portion of a matrix in sparse format + bmat - Build a sparse matrix from sparse sub-blocks + hstack - Stack sparse matrices horizontally (column wise) + vstack - Stack sparse matrices vertically (row wise) + rand - Random values in a given shape + +Identifying sparse matrices: + +.. autosummary:: + :toctree: generated/ + + issparse + isspmatrix + isspmatrix_csc + isspmatrix_csr + isspmatrix_bsr + isspmatrix_lil + isspmatrix_dok + isspmatrix_coo + isspmatrix_dia + +Graph algorithms: + +.. autosummary:: + :toctree: generated/ + + cs_graph_components -- Determine connected components of a graph + +Exceptions +---------- + +.. autosummary:: + :toctree: generated/ + + SparseEfficiencyWarning + SparseWarning + + +Usage information +================= + +There are seven available sparse matrix types: + + 1. csc_matrix: Compressed Sparse Column format + 2. csr_matrix: Compressed Sparse Row format + 3. bsr_matrix: Block Sparse Row format + 4. lil_matrix: List of Lists format + 5. dok_matrix: Dictionary of Keys format + 6. coo_matrix: COOrdinate format (aka IJV, triplet format) + 7. dia_matrix: DIAgonal format + +To construct a matrix efficiently, use either lil_matrix (recommended) or +dok_matrix. The lil_matrix class supports basic slicing and fancy +indexing with a similar syntax to NumPy arrays. As illustrated below, +the COO format may also be used to efficiently construct matrices. + +To perform manipulations such as multiplication or inversion, first +convert the matrix to either CSC or CSR format. The lil_matrix format is +row-based, so conversion to CSR is efficient, whereas conversion to CSC +is less so. + +All conversions among the CSR, CSC, and COO formats are efficient, +linear-time operations. + +Example 1 +--------- +Construct a 1000x1000 lil_matrix and add some values to it: + +>>> from scipy.sparse import lil_matrix +>>> from scipy.sparse.linalg import spsolve +>>> from numpy.linalg import solve, norm +>>> from numpy.random import rand + +>>> A = lil_matrix((1000, 1000)) +>>> A[0, :100] = rand(100) +>>> A[1, 100:200] = A[0, :100] +>>> A.setdiag(rand(1000)) + +Now convert it to CSR format and solve A x = b for x: + +>>> A = A.tocsr() +>>> b = rand(1000) +>>> x = spsolve(A, b) + +Convert it to a dense matrix and solve, and check that the result +is the same: + +>>> x_ = solve(A.todense(), b) + +Now we can compute norm of the error with: + +>>> err = norm(x-x_) +>>> err < 1e-10 +True + +It should be small :) + + +Example 2 +--------- + +Construct a matrix in COO format: + +>>> from scipy import sparse +>>> from numpy import array +>>> I = array([0,3,1,0]) +>>> J = array([0,3,1,2]) +>>> V = array([4,5,7,9]) +>>> A = sparse.coo_matrix((V,(I,J)),shape=(4,4)) + +Notice that the indices do not need to be sorted. + +Duplicate (i,j) entries are summed when converting to CSR or CSC. + +>>> I = array([0,0,1,3,1,0,0]) +>>> J = array([0,2,1,3,1,0,0]) +>>> V = array([1,1,1,1,1,1,1]) +>>> B = sparse.coo_matrix((V,(I,J)),shape=(4,4)).tocsr() + +This is useful for constructing finite-element stiffness and mass matrices. + +Further Details +--------------- + +CSR column indices are not necessarily sorted. Likewise for CSC row +indices. Use the .sorted_indices() and .sort_indices() methods when +sorted indices are required (e.g. when passing data to other libraries). + +""" + +# Original code by Travis Oliphant. +# Modified and extended by Ed Schofield, Robert Cimrman, and Nathan Bell. from base import * from csr import * diff --git a/scipy/sparse/info.py b/scipy/sparse/info.py deleted file mode 100644 index b5974472767f..000000000000 --- a/scipy/sparse/info.py +++ /dev/null @@ -1,176 +0,0 @@ -""" -===================================== -Sparse matrices (:mod:`scipy.sparse`) -===================================== - -.. currentmodule:: scipy.sparse - -SciPy 2-D sparse matrix package. - -Contents -======== - -Sparse matrix classes ---------------------- - -.. autosummary:: - :toctree: generated/ - - bsr_matrix - Block Sparse Row matrix - coo_matrix - A sparse matrix in COOrdinate format - csc_matrix - Compressed Sparse Column matrix - csr_matrix - Compressed Sparse Row matrix - dia_matrix - Sparse matrix with DIAgonal storage - dok_matrix - Dictionary Of Keys based sparse matrix - lil_matrix - Row-based linked list sparse matrix - -Functions ---------- - -Building sparse matrices: - -.. autosummary:: - :toctree: generated/ - - eye - Sparse MxN matrix whose k-th diagonal is all ones - identity - Identity matrix in sparse format - kron - kronecker product of two sparse matrices - kronsum - kronecker sum of sparse matrices - spdiags - Return a sparse matrix from diagonals - tril - Lower triangular portion of a matrix in sparse format - triu - Upper triangular portion of a matrix in sparse format - bmat - Build a sparse matrix from sparse sub-blocks - hstack - Stack sparse matrices horizontally (column wise) - vstack - Stack sparse matrices vertically (row wise) - rand - Random values in a given shape - -Identifying sparse matrices: - -.. autosummary:: - :toctree: generated/ - - issparse - isspmatrix - isspmatrix_csc - isspmatrix_csr - isspmatrix_bsr - isspmatrix_lil - isspmatrix_dok - isspmatrix_coo - isspmatrix_dia - -Graph algorithms: - -.. autosummary:: - :toctree: generated/ - - cs_graph_components -- Determine connected components of a graph - -Exceptions ----------- - -.. autosummary:: - :toctree: generated/ - - SparseEfficiencyWarning - SparseWarning - - -Usage information -================= - -There are seven available sparse matrix types: - - 1. csc_matrix: Compressed Sparse Column format - 2. csr_matrix: Compressed Sparse Row format - 3. bsr_matrix: Block Sparse Row format - 4. lil_matrix: List of Lists format - 5. dok_matrix: Dictionary of Keys format - 6. coo_matrix: COOrdinate format (aka IJV, triplet format) - 7. dia_matrix: DIAgonal format - -To construct a matrix efficiently, use either lil_matrix (recommended) or -dok_matrix. The lil_matrix class supports basic slicing and fancy -indexing with a similar syntax to NumPy arrays. As illustrated below, -the COO format may also be used to efficiently construct matrices. - -To perform manipulations such as multiplication or inversion, first -convert the matrix to either CSC or CSR format. The lil_matrix format is -row-based, so conversion to CSR is efficient, whereas conversion to CSC -is less so. - -All conversions among the CSR, CSC, and COO formats are efficient, -linear-time operations. - -Example 1 ---------- -Construct a 1000x1000 lil_matrix and add some values to it: - ->>> from scipy.sparse import lil_matrix ->>> from scipy.sparse.linalg import spsolve ->>> from numpy.linalg import solve, norm ->>> from numpy.random import rand - ->>> A = lil_matrix((1000, 1000)) ->>> A[0, :100] = rand(100) ->>> A[1, 100:200] = A[0, :100] ->>> A.setdiag(rand(1000)) - -Now convert it to CSR format and solve A x = b for x: - ->>> A = A.tocsr() ->>> b = rand(1000) ->>> x = spsolve(A, b) - -Convert it to a dense matrix and solve, and check that the result -is the same: - ->>> x_ = solve(A.todense(), b) - -Now we can compute norm of the error with: - ->>> err = norm(x-x_) ->>> err < 1e-10 -True - -It should be small :) - - -Example 2 ---------- - -Construct a matrix in COO format: - ->>> from scipy import sparse ->>> from numpy import array ->>> I = array([0,3,1,0]) ->>> J = array([0,3,1,2]) ->>> V = array([4,5,7,9]) ->>> A = sparse.coo_matrix((V,(I,J)),shape=(4,4)) - -Notice that the indices do not need to be sorted. - -Duplicate (i,j) entries are summed when converting to CSR or CSC. - ->>> I = array([0,0,1,3,1,0,0]) ->>> J = array([0,2,1,3,1,0,0]) ->>> V = array([1,1,1,1,1,1,1]) ->>> B = sparse.coo_matrix((V,(I,J)),shape=(4,4)).tocsr() - -This is useful for constructing finite-element stiffness and mass matrices. - -Further Details ---------------- - -CSR column indices are not necessarily sorted. Likewise for CSC row -indices. Use the .sorted_indices() and .sort_indices() methods when -sorted indices are required (e.g. when passing data to other libraries). - -""" - -# Original code by Travis Oliphant. -# Modified and extended by Ed Schofield, Robert Cimrman, and Nathan Bell. - -__docformat__ = "restructuredtext en" - -postpone_import = 1 diff --git a/scipy/spatial/__init__.py b/scipy/spatial/__init__.py index a9b15fa976af..6010ecabfd3c 100644 --- a/scipy/spatial/__init__.py +++ b/scipy/spatial/__init__.py @@ -1,8 +1,27 @@ -# -# spatial - Distances -# +""" +============================================================= +Spatial algorithms and data structures (:mod:`scipy.spatial`) +============================================================= + +Nearest-neighbor queries: + +.. autosummary:: + :toctree: generated/ + + KDTree -- class for efficient nearest-neighbor queries + cKDTree -- class for efficient nearest-neighbor queries (faster impl.) + distance -- module containing many different distance measures + +Delaunay triangulation: + +.. autosummary:: + :toctree: generated/ + + Delaunay + tsearch + +""" -from info import __doc__ from kdtree import * from ckdtree import * from qhull import * diff --git a/scipy/spatial/info.py b/scipy/spatial/info.py deleted file mode 100644 index f47c41a015af..000000000000 --- a/scipy/spatial/info.py +++ /dev/null @@ -1,25 +0,0 @@ -""" -============================================================= -Spatial algorithms and data structures (:mod:`scipy.spatial`) -============================================================= - -Nearest-neighbor queries: - -.. autosummary:: - :toctree: generated/ - - KDTree -- class for efficient nearest-neighbor queries - cKDTree -- class for efficient nearest-neighbor queries (faster impl.) - distance -- module containing many different distance measures - -Delaunay triangulation: - -.. autosummary:: - :toctree: generated/ - - Delaunay - tsearch - -""" - -postpone_import = 1 diff --git a/scipy/special/__init__.py b/scipy/special/__init__.py index 2a9377d06cfc..47e40c44aad8 100644 --- a/scipy/special/__init__.py +++ b/scipy/special/__init__.py @@ -1,8 +1,522 @@ -# -# special - Special Functions -# +""" +======================================== +Special functions (:mod:`scipy.special`) +======================================== + +.. module:: scipy.special + +Nearly all of the functions below are universal functions and follow +broadcasting and automatic array-looping rules. Exceptions are noted. + +Error handling +============== + +Errors are handled by returning nans, or other appropriate values. +Some of the special function routines will emit warnings when an error +occurs. By default this is disabled. To enable such messages use +``errprint(1)``, and to disable such messages use ``errprint(0)``. + +Example: + + >>> print scipy.special.bdtr(-1,10,0.3) + >>> scipy.special.errprint(1) + >>> print scipy.special.bdtr(-1,10,0.3) + +.. autosummary:: + :toctree: generated/ + + errprint + +Available functions +=================== + +Airy functions +-------------- + +.. autosummary:: + :toctree: generated/ + + airy -- Airy functions and their derivatives. + airye -- Exponentially scaled Airy functions + ai_zeros -- [+]Zeros of Airy functions Ai(x) and Ai'(x) + bi_zeros -- [+]Zeros of Airy functions Bi(x) and Bi'(x) + + +Elliptic Functions and Integrals +-------------------------------- + +.. autosummary:: + :toctree: generated/ + + ellipj -- Jacobian elliptic functions + ellipk -- Complete elliptic integral of the first kind. + ellipkinc -- Incomplete elliptic integral of the first kind. + ellipe -- Complete elliptic integral of the second kind. + ellipeinc -- Incomplete elliptic integral of the second kind. + +Bessel Functions +---------------- + +.. autosummary:: + :toctree: generated/ + + jn -- Bessel function of integer order and real argument. + jv -- Bessel function of real-valued order and complex argument. + jve -- Exponentially scaled Bessel function. + yn -- Bessel function of second kind (integer order). + yv -- Bessel function of the second kind (real-valued order). + yve -- Exponentially scaled Bessel function of the second kind. + kn -- Modified Bessel function of the second kind (integer order). + kv -- Modified Bessel function of the second kind (real order). + kve -- Exponentially scaled modified Bessel function of the second kind. + iv -- Modified Bessel function. + ive -- Exponentially scaled modified Bessel function. + hankel1 -- Hankel function of the first kind. + hankel1e -- Exponentially scaled Hankel function of the first kind. + hankel2 -- Hankel function of the second kind. + hankel2e -- Exponentially scaled Hankel function of the second kind. + +The following is not an universal function: + +.. autosummary:: + :toctree: generated/ + + lmbda -- [+]Sequence of lambda functions with arbitrary order v. + +Zeros of Bessel Functions +^^^^^^^^^^^^^^^^^^^^^^^^^ + +These are not universal functions: + +.. autosummary:: + :toctree: generated/ + + jnjnp_zeros -- [+]Zeros of integer-order Bessel functions and derivatives sorted in order. + jnyn_zeros -- [+]Zeros of integer-order Bessel functions and derivatives as separate arrays. + jn_zeros -- [+]Zeros of Jn(x) + jnp_zeros -- [+]Zeros of Jn'(x) + yn_zeros -- [+]Zeros of Yn(x) + ynp_zeros -- [+]Zeros of Yn'(x) + y0_zeros -- [+]Complex zeros: Y0(z0)=0 and values of Y0'(z0) + y1_zeros -- [+]Complex zeros: Y1(z1)=0 and values of Y1'(z1) + y1p_zeros -- [+]Complex zeros of Y1'(z1')=0 and values of Y1(z1') + +Faster versions of common Bessel Functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :toctree: generated/ + + j0 -- Bessel function of order 0. + j1 -- Bessel function of order 1. + y0 -- Bessel function of second kind of order 0. + y1 -- Bessel function of second kind of order 1. + i0 -- Modified Bessel function of order 0. + i0e -- Exponentially scaled modified Bessel function of order 0. + i1 -- Modified Bessel function of order 1. + i1e -- Exponentially scaled modified Bessel function of order 1. + k0 -- Modified Bessel function of the second kind of order 0. + k0e -- Exponentially scaled modified Bessel function of the second kind of order 0. + k1 -- Modified Bessel function of the second kind of order 1. + k1e -- Exponentially scaled modified Bessel function of the second kind of order 1. + +Integrals of Bessel Functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :toctree: generated/ + + itj0y0 -- Basic integrals of j0 and y0 from 0 to x. + it2j0y0 -- Integrals of (1-j0(t))/t from 0 to x and y0(t)/t from x to inf. + iti0k0 -- Basic integrals of i0 and k0 from 0 to x. + it2i0k0 -- Integrals of (i0(t)-1)/t from 0 to x and k0(t)/t from x to inf. + besselpoly -- Integral of a bessel function: Jv(2* a* x) * x[+]lambda from x=0 to 1. + +Derivatives of Bessel Functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :toctree: generated/ + + jvp -- Nth derivative of Jv(v,z) + yvp -- Nth derivative of Yv(v,z) + kvp -- Nth derivative of Kv(v,z) + ivp -- Nth derivative of Iv(v,z) + h1vp -- Nth derivative of H1v(v,z) + h2vp -- Nth derivative of H2v(v,z) + +Spherical Bessel Functions +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +These are not universal functions: + +.. autosummary:: + :toctree: generated/ + + sph_jn -- [+]Sequence of spherical Bessel functions, jn(z) + sph_yn -- [+]Sequence of spherical Bessel functions, yn(z) + sph_jnyn -- [+]Sequence of spherical Bessel functions, jn(z) and yn(z) + sph_in -- [+]Sequence of spherical Bessel functions, in(z) + sph_kn -- [+]Sequence of spherical Bessel functions, kn(z) + sph_inkn -- [+]Sequence of spherical Bessel functions, in(z) and kn(z) + +Riccati-Bessel Functions +^^^^^^^^^^^^^^^^^^^^^^^^ + +These are not universal functions: + +.. autosummary:: + :toctree: generated/ + + riccati_jn -- [+]Sequence of Ricatti-Bessel functions of first kind. + riccati_yn -- [+]Sequence of Ricatti-Bessel functions of second kind. + +Struve Functions +---------------- + +.. autosummary:: + :toctree: generated/ + + struve -- Struve function --- Hv(x) + modstruve -- Modified struve function --- Lv(x) + itstruve0 -- Integral of H0(t) from 0 to x + it2struve0 -- Integral of H0(t)/t from x to Inf. + itmodstruve0 -- Integral of L0(t) from 0 to x. + + +Raw Statistical Functions +------------------------- + +.. seealso:: :mod:`scipy.stats`: Friendly versions of these functions. + +.. autosummary:: + :toctree: generated/ + + bdtr -- Sum of terms 0 through k of of the binomial pdf. + bdtrc -- Sum of terms k+1 through n of the binomial pdf. + bdtri -- Inverse of bdtr + btdtr -- Integral from 0 to x of beta pdf. + btdtri -- Quantiles of beta distribution + fdtr -- Integral from 0 to x of F pdf. + fdtrc -- Integral from x to infinity under F pdf. + fdtri -- Inverse of fdtrc + gdtr -- Integral from 0 to x of gamma pdf. + gdtrc -- Integral from x to infinity under gamma pdf. + gdtria -- + gdtrib -- + gdtrix -- + nbdtr -- Sum of terms 0 through k of the negative binomial pdf. + nbdtrc -- Sum of terms k+1 to infinity under negative binomial pdf. + nbdtri -- Inverse of nbdtr + pdtr -- Sum of terms 0 through k of the Poisson pdf. + pdtrc -- Sum of terms k+1 to infinity of the Poisson pdf. + pdtri -- Inverse of pdtr + stdtr -- Integral from -infinity to t of the Student-t pdf. + stdtridf -- + stdtrit -- + chdtr -- Integral from 0 to x of the Chi-square pdf. + chdtrc -- Integral from x to infnity of Chi-square pdf. + chdtri -- Inverse of chdtrc. + ndtr -- Integral from -infinity to x of standard normal pdf + ndtri -- Inverse of ndtr (quantiles) + smirnov -- Kolmogorov-Smirnov complementary CDF for one-sided test statistic (Dn+ or Dn-) + smirnovi -- Inverse of smirnov. + kolmogorov -- The complementary CDF of the (scaled) two-sided test statistic (Kn*) valid for large n. + kolmogi -- Inverse of kolmogorov + tklmbda -- Tukey-Lambda CDF + +Gamma and Related Functions +--------------------------- + +.. autosummary:: + :toctree: generated/ + + gamma -- Gamma function. + gammaln -- Log of the absolute value of the gamma function. + gammainc -- Incomplete gamma integral. + gammaincinv -- Inverse of gammainc. + gammaincc -- Complemented incomplete gamma integral. + gammainccinv -- Inverse of gammaincc. + beta -- Beta function. + betaln -- Log of the absolute value of the beta function. + betainc -- Incomplete beta integral. + betaincinv -- Inverse of betainc. + psi -- Logarithmic derivative of the gamma function. + rgamma -- One divided by the gamma function. + polygamma -- Nth derivative of psi function. + multigammaln + + +Error Function and Fresnel Integrals +------------------------------------ + +.. autosummary:: + :toctree: generated/ + + erf -- Error function. + erfc -- Complemented error function (1- erf(x)) + erfinv -- Inverse of error function + erfcinv -- Inverse of erfc + fresnel -- Fresnel sine and cosine integrals. + fresnel_zeros -- Complex zeros of both Fresnel integrals + modfresnelp -- Modified Fresnel integrals F_+(x) and K_+(x) + modfresnelm -- Modified Fresnel integrals F_-(x) and K_-(x) + +These are not universal functions: + +.. autosummary:: + :toctree: generated/ + + erf_zeros -- [+]Complex zeros of erf(z) + fresnelc_zeros -- [+]Complex zeros of fresnel cosine integrals + fresnels_zeros -- [+]Complex zeros of fresnel sine integrals + +Legendre Functions +------------------ + +.. autosummary:: + :toctree: generated/ + + lpmv -- Associated Legendre Function of arbitrary non-negative degree v. + sph_harm -- Spherical Harmonics (complex-valued) Y^m_n(theta,phi) + +These are not universal functions: + +.. autosummary:: + :toctree: generated/ + + lpn -- [+]Legendre Functions (polynomials) of the first kind + lqn -- [+]Legendre Functions of the second kind. + lpmn -- [+]Associated Legendre Function of the first kind. + lqmn -- [+]Associated Legendre Function of the second kind. + +Orthogonal polynomials +---------------------- + +The following functions evaluate values of orthogonal polynomials: + +.. autosummary:: + :toctree: generated/ + + eval_legendre + eval_chebyt + eval_chebyu + eval_chebyc + eval_chebys + eval_jacobi + eval_laguerre + eval_genlaguerre + eval_hermite + eval_hermitenorm + eval_gegenbauer + eval_sh_legendre + eval_sh_chebyt + eval_sh_chebyu + eval_sh_jacobi + +The functions below, in turn, return :ref:`orthopoly1d` objects, which +functions similarly as :ref:`numpy.poly1d`. The :ref:`orthopoly1d` +class also has an attribute ``weights`` which returns the roots, weights, +and total weights for the appropriate form of Gaussian quadrature. +These are returned in an ``n x 3`` array with roots in the first column, +weights in the second column, and total weights in the final column. + +.. autosummary:: + :toctree: generated/ + + legendre -- [+]Legendre polynomial P_n(x) (lpn -- for function). + chebyt -- [+]Chebyshev polynomial T_n(x) + chebyu -- [+]Chebyshev polynomial U_n(x) + chebyc -- [+]Chebyshev polynomial C_n(x) + chebys -- [+]Chebyshev polynomial S_n(x) + jacobi -- [+]Jacobi polynomial P^(alpha,beta)_n(x) + laguerre -- [+]Laguerre polynomial, L_n(x) + genlaguerre -- [+]Generalized (Associated) Laguerre polynomial, L^alpha_n(x) + hermite -- [+]Hermite polynomial H_n(x) + hermitenorm -- [+]Normalized Hermite polynomial, He_n(x) + gegenbauer -- [+]Gegenbauer (Ultraspherical) polynomials, C^(alpha)_n(x) + sh_legendre -- [+]shifted Legendre polynomial, P*_n(x) + sh_chebyt -- [+]shifted Chebyshev polynomial, T*_n(x) + sh_chebyu -- [+]shifted Chebyshev polynomial, U*_n(x) + sh_jacobi -- [+]shifted Jacobi polynomial, J*_n(x) = G^(p,q)_n(x) + +.. warning:: + + Large-order polynomials obtained from these functions + are numerically unstable. + + ``orthopoly1d`` objects are converted to ``poly1d``, when doing + arithmetic. ``numpy.poly1d`` works in power basis and cannot + represent high-order polynomials accurately, which can cause + significant inaccuracy. + + +Hypergeometric Functions +------------------------ + +.. autosummary:: + :toctree: generated/ + + hyp2f1 -- Gauss hypergeometric function (2F1) + hyp1f1 -- Confluent hypergeometric function (1F1) + hyperu -- Confluent hypergeometric function (U) + hyp0f1 -- Confluent hypergeometric limit function (0F1) + hyp2f0 -- Hypergeometric function (2F0) + hyp1f2 -- Hypergeometric function (1F2) + hyp3f0 -- Hypergeometric function (3F0) + + +Parabolic Cylinder Functions +---------------------------- + +.. autosummary:: + :toctree: generated/ + + pbdv -- Parabolic cylinder function Dv(x) and derivative. + pbvv -- Parabolic cylinder function Vv(x) and derivative. + pbwa -- Parabolic cylinder function W(a,x) and derivative. + +These are not universal functions: + +.. autosummary:: + :toctree: generated/ + + pbdv_seq -- [+]Sequence of parabolic cylinder functions Dv(x) + pbvv_seq -- [+]Sequence of parabolic cylinder functions Vv(x) + pbdn_seq -- [+]Sequence of parabolic cylinder functions Dn(z), complex z + +Mathieu and Related Functions +----------------------------- + +.. autosummary:: + :toctree: generated/ + + mathieu_a -- Characteristic values for even solution (ce_m) + mathieu_b -- Characteristic values for odd solution (se_m) + +These are not universal functions: + +.. autosummary:: + :toctree: generated/ + + mathieu_even_coef -- [+]sequence of expansion coefficients for even solution + mathieu_odd_coef -- [+]sequence of expansion coefficients for odd solution + +The following return both function and first derivative: + +.. autosummary:: + :toctree: generated/ + + mathieu_cem -- Even mathieu function + mathieu_sem -- Odd mathieu function + mathieu_modcem1 -- Even modified mathieu function of the first kind + mathieu_modcem2 -- Even modified mathieu function of the second kind + mathieu_modsem1 -- Odd modified mathieu function of the first kind + mathieu_modsem2 -- Odd modified mathieu function of the second kind + +Spheroidal Wave Functions +------------------------- + +.. autosummary:: + :toctree: generated/ + + pro_ang1 -- Prolate spheroidal angular function of the first kind + pro_rad1 -- Prolate spheroidal radial function of the first kind + pro_rad2 -- Prolate spheroidal radial function of the second kind + obl_ang1 -- Oblate spheroidal angluar function of the first kind + obl_rad1 -- Oblate spheroidal radial function of the first kind + obl_rad2 -- Oblate spheroidal radial function of the second kind + pro_cv -- Compute characteristic value for prolate functions + obl_cv -- Compute characteristic value for oblate functions + pro_cv_seq -- Compute sequence of prolate characteristic values + obl_cv_seq -- Compute sequence of oblate characteristic values + +The following functions require pre-computed characteristic value: + +.. autosummary:: + :toctree: generated/ + + pro_ang1_cv -- Prolate spheroidal angular function of the first kind + pro_rad1_cv -- Prolate spheroidal radial function of the first kind + pro_rad2_cv -- Prolate spheroidal radial function of the second kind + obl_ang1_cv -- Oblate spheroidal angluar function of the first kind + obl_rad1_cv -- Oblate spheroidal radial function of the first kind + obl_rad2_cv -- Oblate spheroidal radial function of the second kind + +Kelvin Functions +---------------- + +.. autosummary:: + :toctree: generated/ + + kelvin -- All Kelvin functions (order 0) and derivatives. + kelvin_zeros -- [+]Zeros of All Kelvin functions (order 0) and derivatives + ber -- Kelvin function ber x + bei -- Kelvin function bei x + berp -- Derivative of Kelvin function ber x + beip -- Derivative of Kelvin function bei x + ker -- Kelvin function ker x + kei -- Kelvin function kei x + kerp -- Derivative of Kelvin function ker x + keip -- Derivative of Kelvin function kei x + +These are not universal functions: + +.. autosummary:: + :toctree: generated/ + + ber_zeros -- [+]Zeros of Kelvin function bei x + bei_zeros -- [+]Zeros of Kelvin function ber x + berp_zeros -- [+]Zeros of derivative of Kelvin function ber x + beip_zeros -- [+]Zeros of derivative of Kelvin function bei x + ker_zeros -- [+]Zeros of Kelvin function kei x + kei_zeros -- [+]Zeros of Kelvin function ker x + kerp_zeros -- [+]Zeros of derivative of Kelvin function ker x + keip_zeros -- [+]Zeros of derivative of Kelvin function kei x + +Other Special Functions +----------------------- + +.. autosummary:: + :toctree: generated/ + + expn -- Exponential integral. + exp1 -- Exponential integral of order 1 (for complex argument) + expi -- Another exponential integral -- Ei(x) + wofz -- Fadeeva function. + dawsn -- Dawson's integral. + shichi -- Hyperbolic sine and cosine integrals. + sici -- Integral of the sinc and "cosinc" functions. + spence -- Dilogarithm integral. + lambertw -- Lambert W function + zeta -- Riemann zeta function of two arguments. + zetac -- 1.0 - standard Riemann zeta function. + +Convenience Functions +--------------------- + +.. autosummary:: + :toctree: generated/ + + cbrt -- Cube root. + exp10 -- 10 raised to the x power. + exp2 -- 2 raised to the x power. + radian -- radian angle given degrees, minutes, and seconds. + cosdg -- cosine of the angle given in degrees. + sindg -- sine of the angle given in degrees. + tandg -- tangent of the angle given in degrees. + cotdg -- cotangent of the angle given in degrees. + log1p -- log(1+x) + expm1 -- exp(x)-1 + cosm1 -- cos(x)-1 + round -- round the argument to the nearest integer. If argument ends in 0.5 exactly, pick the nearest even integer. + +.. [+] in the description indicates a function which is not a universal +.. function and does not follow broadcasting and automatic +.. array-looping rules. + +""" -from info import __doc__, __docformat__ #from special_version import special_version as __version__ from _cephes import * diff --git a/scipy/special/info.py b/scipy/special/info.py deleted file mode 100644 index babc691d4d4e..000000000000 --- a/scipy/special/info.py +++ /dev/null @@ -1,521 +0,0 @@ -""" -======================================== -Special functions (:mod:`scipy.special`) -======================================== - -.. module:: scipy.special - -Nearly all of the functions below are universal functions and follow -broadcasting and automatic array-looping rules. Exceptions are noted. - -Error handling -============== - -Errors are handled by returning nans, or other appropriate values. -Some of the special function routines will emit warnings when an error -occurs. By default this is disabled. To enable such messages use -``errprint(1)``, and to disable such messages use ``errprint(0)``. - -Example: - - >>> print scipy.special.bdtr(-1,10,0.3) - >>> scipy.special.errprint(1) - >>> print scipy.special.bdtr(-1,10,0.3) - -.. autosummary:: - :toctree: generated/ - - errprint - -Available functions -=================== - -Airy functions --------------- - -.. autosummary:: - :toctree: generated/ - - airy -- Airy functions and their derivatives. - airye -- Exponentially scaled Airy functions - ai_zeros -- [+]Zeros of Airy functions Ai(x) and Ai'(x) - bi_zeros -- [+]Zeros of Airy functions Bi(x) and Bi'(x) - - -Elliptic Functions and Integrals --------------------------------- - -.. autosummary:: - :toctree: generated/ - - ellipj -- Jacobian elliptic functions - ellipk -- Complete elliptic integral of the first kind. - ellipkinc -- Incomplete elliptic integral of the first kind. - ellipe -- Complete elliptic integral of the second kind. - ellipeinc -- Incomplete elliptic integral of the second kind. - -Bessel Functions ----------------- - -.. autosummary:: - :toctree: generated/ - - jn -- Bessel function of integer order and real argument. - jv -- Bessel function of real-valued order and complex argument. - jve -- Exponentially scaled Bessel function. - yn -- Bessel function of second kind (integer order). - yv -- Bessel function of the second kind (real-valued order). - yve -- Exponentially scaled Bessel function of the second kind. - kn -- Modified Bessel function of the second kind (integer order). - kv -- Modified Bessel function of the second kind (real order). - kve -- Exponentially scaled modified Bessel function of the second kind. - iv -- Modified Bessel function. - ive -- Exponentially scaled modified Bessel function. - hankel1 -- Hankel function of the first kind. - hankel1e -- Exponentially scaled Hankel function of the first kind. - hankel2 -- Hankel function of the second kind. - hankel2e -- Exponentially scaled Hankel function of the second kind. - -The following is not an universal function: - -.. autosummary:: - :toctree: generated/ - - lmbda -- [+]Sequence of lambda functions with arbitrary order v. - -Zeros of Bessel Functions -^^^^^^^^^^^^^^^^^^^^^^^^^ - -These are not universal functions: - -.. autosummary:: - :toctree: generated/ - - jnjnp_zeros -- [+]Zeros of integer-order Bessel functions and derivatives sorted in order. - jnyn_zeros -- [+]Zeros of integer-order Bessel functions and derivatives as separate arrays. - jn_zeros -- [+]Zeros of Jn(x) - jnp_zeros -- [+]Zeros of Jn'(x) - yn_zeros -- [+]Zeros of Yn(x) - ynp_zeros -- [+]Zeros of Yn'(x) - y0_zeros -- [+]Complex zeros: Y0(z0)=0 and values of Y0'(z0) - y1_zeros -- [+]Complex zeros: Y1(z1)=0 and values of Y1'(z1) - y1p_zeros -- [+]Complex zeros of Y1'(z1')=0 and values of Y1(z1') - -Faster versions of common Bessel Functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. autosummary:: - :toctree: generated/ - - j0 -- Bessel function of order 0. - j1 -- Bessel function of order 1. - y0 -- Bessel function of second kind of order 0. - y1 -- Bessel function of second kind of order 1. - i0 -- Modified Bessel function of order 0. - i0e -- Exponentially scaled modified Bessel function of order 0. - i1 -- Modified Bessel function of order 1. - i1e -- Exponentially scaled modified Bessel function of order 1. - k0 -- Modified Bessel function of the second kind of order 0. - k0e -- Exponentially scaled modified Bessel function of the second kind of order 0. - k1 -- Modified Bessel function of the second kind of order 1. - k1e -- Exponentially scaled modified Bessel function of the second kind of order 1. - -Integrals of Bessel Functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. autosummary:: - :toctree: generated/ - - itj0y0 -- Basic integrals of j0 and y0 from 0 to x. - it2j0y0 -- Integrals of (1-j0(t))/t from 0 to x and y0(t)/t from x to inf. - iti0k0 -- Basic integrals of i0 and k0 from 0 to x. - it2i0k0 -- Integrals of (i0(t)-1)/t from 0 to x and k0(t)/t from x to inf. - besselpoly -- Integral of a bessel function: Jv(2* a* x) * x[+]lambda from x=0 to 1. - -Derivatives of Bessel Functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. autosummary:: - :toctree: generated/ - - jvp -- Nth derivative of Jv(v,z) - yvp -- Nth derivative of Yv(v,z) - kvp -- Nth derivative of Kv(v,z) - ivp -- Nth derivative of Iv(v,z) - h1vp -- Nth derivative of H1v(v,z) - h2vp -- Nth derivative of H2v(v,z) - -Spherical Bessel Functions -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -These are not universal functions: - -.. autosummary:: - :toctree: generated/ - - sph_jn -- [+]Sequence of spherical Bessel functions, jn(z) - sph_yn -- [+]Sequence of spherical Bessel functions, yn(z) - sph_jnyn -- [+]Sequence of spherical Bessel functions, jn(z) and yn(z) - sph_in -- [+]Sequence of spherical Bessel functions, in(z) - sph_kn -- [+]Sequence of spherical Bessel functions, kn(z) - sph_inkn -- [+]Sequence of spherical Bessel functions, in(z) and kn(z) - -Riccati-Bessel Functions -^^^^^^^^^^^^^^^^^^^^^^^^ - -These are not universal functions: - -.. autosummary:: - :toctree: generated/ - - riccati_jn -- [+]Sequence of Ricatti-Bessel functions of first kind. - riccati_yn -- [+]Sequence of Ricatti-Bessel functions of second kind. - -Struve Functions ----------------- - -.. autosummary:: - :toctree: generated/ - - struve -- Struve function --- Hv(x) - modstruve -- Modified struve function --- Lv(x) - itstruve0 -- Integral of H0(t) from 0 to x - it2struve0 -- Integral of H0(t)/t from x to Inf. - itmodstruve0 -- Integral of L0(t) from 0 to x. - - -Raw Statistical Functions -------------------------- - -.. seealso:: :mod:`scipy.stats`: Friendly versions of these functions. - -.. autosummary:: - :toctree: generated/ - - bdtr -- Sum of terms 0 through k of of the binomial pdf. - bdtrc -- Sum of terms k+1 through n of the binomial pdf. - bdtri -- Inverse of bdtr - btdtr -- Integral from 0 to x of beta pdf. - btdtri -- Quantiles of beta distribution - fdtr -- Integral from 0 to x of F pdf. - fdtrc -- Integral from x to infinity under F pdf. - fdtri -- Inverse of fdtrc - gdtr -- Integral from 0 to x of gamma pdf. - gdtrc -- Integral from x to infinity under gamma pdf. - gdtria -- - gdtrib -- - gdtrix -- - nbdtr -- Sum of terms 0 through k of the negative binomial pdf. - nbdtrc -- Sum of terms k+1 to infinity under negative binomial pdf. - nbdtri -- Inverse of nbdtr - pdtr -- Sum of terms 0 through k of the Poisson pdf. - pdtrc -- Sum of terms k+1 to infinity of the Poisson pdf. - pdtri -- Inverse of pdtr - stdtr -- Integral from -infinity to t of the Student-t pdf. - stdtridf -- - stdtrit -- - chdtr -- Integral from 0 to x of the Chi-square pdf. - chdtrc -- Integral from x to infnity of Chi-square pdf. - chdtri -- Inverse of chdtrc. - ndtr -- Integral from -infinity to x of standard normal pdf - ndtri -- Inverse of ndtr (quantiles) - smirnov -- Kolmogorov-Smirnov complementary CDF for one-sided test statistic (Dn+ or Dn-) - smirnovi -- Inverse of smirnov. - kolmogorov -- The complementary CDF of the (scaled) two-sided test statistic (Kn*) valid for large n. - kolmogi -- Inverse of kolmogorov - tklmbda -- Tukey-Lambda CDF - -Gamma and Related Functions ---------------------------- - -.. autosummary:: - :toctree: generated/ - - gamma -- Gamma function. - gammaln -- Log of the absolute value of the gamma function. - gammainc -- Incomplete gamma integral. - gammaincinv -- Inverse of gammainc. - gammaincc -- Complemented incomplete gamma integral. - gammainccinv -- Inverse of gammaincc. - beta -- Beta function. - betaln -- Log of the absolute value of the beta function. - betainc -- Incomplete beta integral. - betaincinv -- Inverse of betainc. - psi -- Logarithmic derivative of the gamma function. - rgamma -- One divided by the gamma function. - polygamma -- Nth derivative of psi function. - multigammaln - - -Error Function and Fresnel Integrals ------------------------------------- - -.. autosummary:: - :toctree: generated/ - - erf -- Error function. - erfc -- Complemented error function (1- erf(x)) - erfinv -- Inverse of error function - erfcinv -- Inverse of erfc - fresnel -- Fresnel sine and cosine integrals. - fresnel_zeros -- Complex zeros of both Fresnel integrals - modfresnelp -- Modified Fresnel integrals F_+(x) and K_+(x) - modfresnelm -- Modified Fresnel integrals F_-(x) and K_-(x) - -These are not universal functions: - -.. autosummary:: - :toctree: generated/ - - erf_zeros -- [+]Complex zeros of erf(z) - fresnelc_zeros -- [+]Complex zeros of fresnel cosine integrals - fresnels_zeros -- [+]Complex zeros of fresnel sine integrals - -Legendre Functions ------------------- - -.. autosummary:: - :toctree: generated/ - - lpmv -- Associated Legendre Function of arbitrary non-negative degree v. - sph_harm -- Spherical Harmonics (complex-valued) Y^m_n(theta,phi) - -These are not universal functions: - -.. autosummary:: - :toctree: generated/ - - lpn -- [+]Legendre Functions (polynomials) of the first kind - lqn -- [+]Legendre Functions of the second kind. - lpmn -- [+]Associated Legendre Function of the first kind. - lqmn -- [+]Associated Legendre Function of the second kind. - -Orthogonal polynomials ----------------------- - -The following functions evaluate values of orthogonal polynomials: - -.. autosummary:: - :toctree: generated/ - - eval_legendre - eval_chebyt - eval_chebyu - eval_chebyc - eval_chebys - eval_jacobi - eval_laguerre - eval_genlaguerre - eval_hermite - eval_hermitenorm - eval_gegenbauer - eval_sh_legendre - eval_sh_chebyt - eval_sh_chebyu - eval_sh_jacobi - -The functions below, in turn, return :ref:`orthopoly1d` objects, which -functions similarly as :ref:`numpy.poly1d`. The :ref:`orthopoly1d` -class also has an attribute ``weights`` which returns the roots, weights, -and total weights for the appropriate form of Gaussian quadrature. -These are returned in an ``n x 3`` array with roots in the first column, -weights in the second column, and total weights in the final column. - -.. autosummary:: - :toctree: generated/ - - legendre -- [+]Legendre polynomial P_n(x) (lpn -- for function). - chebyt -- [+]Chebyshev polynomial T_n(x) - chebyu -- [+]Chebyshev polynomial U_n(x) - chebyc -- [+]Chebyshev polynomial C_n(x) - chebys -- [+]Chebyshev polynomial S_n(x) - jacobi -- [+]Jacobi polynomial P^(alpha,beta)_n(x) - laguerre -- [+]Laguerre polynomial, L_n(x) - genlaguerre -- [+]Generalized (Associated) Laguerre polynomial, L^alpha_n(x) - hermite -- [+]Hermite polynomial H_n(x) - hermitenorm -- [+]Normalized Hermite polynomial, He_n(x) - gegenbauer -- [+]Gegenbauer (Ultraspherical) polynomials, C^(alpha)_n(x) - sh_legendre -- [+]shifted Legendre polynomial, P*_n(x) - sh_chebyt -- [+]shifted Chebyshev polynomial, T*_n(x) - sh_chebyu -- [+]shifted Chebyshev polynomial, U*_n(x) - sh_jacobi -- [+]shifted Jacobi polynomial, J*_n(x) = G^(p,q)_n(x) - -.. warning:: - - Large-order polynomials obtained from these functions - are numerically unstable. - - ``orthopoly1d`` objects are converted to ``poly1d``, when doing - arithmetic. ``numpy.poly1d`` works in power basis and cannot - represent high-order polynomials accurately, which can cause - significant inaccuracy. - - -Hypergeometric Functions ------------------------- - -.. autosummary:: - :toctree: generated/ - - hyp2f1 -- Gauss hypergeometric function (2F1) - hyp1f1 -- Confluent hypergeometric function (1F1) - hyperu -- Confluent hypergeometric function (U) - hyp0f1 -- Confluent hypergeometric limit function (0F1) - hyp2f0 -- Hypergeometric function (2F0) - hyp1f2 -- Hypergeometric function (1F2) - hyp3f0 -- Hypergeometric function (3F0) - - -Parabolic Cylinder Functions ----------------------------- - -.. autosummary:: - :toctree: generated/ - - pbdv -- Parabolic cylinder function Dv(x) and derivative. - pbvv -- Parabolic cylinder function Vv(x) and derivative. - pbwa -- Parabolic cylinder function W(a,x) and derivative. - -These are not universal functions: - -.. autosummary:: - :toctree: generated/ - - pbdv_seq -- [+]Sequence of parabolic cylinder functions Dv(x) - pbvv_seq -- [+]Sequence of parabolic cylinder functions Vv(x) - pbdn_seq -- [+]Sequence of parabolic cylinder functions Dn(z), complex z - -Mathieu and Related Functions ------------------------------ - -.. autosummary:: - :toctree: generated/ - - mathieu_a -- Characteristic values for even solution (ce_m) - mathieu_b -- Characteristic values for odd solution (se_m) - -These are not universal functions: - -.. autosummary:: - :toctree: generated/ - - mathieu_even_coef -- [+]sequence of expansion coefficients for even solution - mathieu_odd_coef -- [+]sequence of expansion coefficients for odd solution - -The following return both function and first derivative: - -.. autosummary:: - :toctree: generated/ - - mathieu_cem -- Even mathieu function - mathieu_sem -- Odd mathieu function - mathieu_modcem1 -- Even modified mathieu function of the first kind - mathieu_modcem2 -- Even modified mathieu function of the second kind - mathieu_modsem1 -- Odd modified mathieu function of the first kind - mathieu_modsem2 -- Odd modified mathieu function of the second kind - -Spheroidal Wave Functions -------------------------- - -.. autosummary:: - :toctree: generated/ - - pro_ang1 -- Prolate spheroidal angular function of the first kind - pro_rad1 -- Prolate spheroidal radial function of the first kind - pro_rad2 -- Prolate spheroidal radial function of the second kind - obl_ang1 -- Oblate spheroidal angluar function of the first kind - obl_rad1 -- Oblate spheroidal radial function of the first kind - obl_rad2 -- Oblate spheroidal radial function of the second kind - pro_cv -- Compute characteristic value for prolate functions - obl_cv -- Compute characteristic value for oblate functions - pro_cv_seq -- Compute sequence of prolate characteristic values - obl_cv_seq -- Compute sequence of oblate characteristic values - -The following functions require pre-computed characteristic value: - -.. autosummary:: - :toctree: generated/ - - pro_ang1_cv -- Prolate spheroidal angular function of the first kind - pro_rad1_cv -- Prolate spheroidal radial function of the first kind - pro_rad2_cv -- Prolate spheroidal radial function of the second kind - obl_ang1_cv -- Oblate spheroidal angluar function of the first kind - obl_rad1_cv -- Oblate spheroidal radial function of the first kind - obl_rad2_cv -- Oblate spheroidal radial function of the second kind - -Kelvin Functions ----------------- - -.. autosummary:: - :toctree: generated/ - - kelvin -- All Kelvin functions (order 0) and derivatives. - kelvin_zeros -- [+]Zeros of All Kelvin functions (order 0) and derivatives - ber -- Kelvin function ber x - bei -- Kelvin function bei x - berp -- Derivative of Kelvin function ber x - beip -- Derivative of Kelvin function bei x - ker -- Kelvin function ker x - kei -- Kelvin function kei x - kerp -- Derivative of Kelvin function ker x - keip -- Derivative of Kelvin function kei x - -These are not universal functions: - -.. autosummary:: - :toctree: generated/ - - ber_zeros -- [+]Zeros of Kelvin function bei x - bei_zeros -- [+]Zeros of Kelvin function ber x - berp_zeros -- [+]Zeros of derivative of Kelvin function ber x - beip_zeros -- [+]Zeros of derivative of Kelvin function bei x - ker_zeros -- [+]Zeros of Kelvin function kei x - kei_zeros -- [+]Zeros of Kelvin function ker x - kerp_zeros -- [+]Zeros of derivative of Kelvin function ker x - keip_zeros -- [+]Zeros of derivative of Kelvin function kei x - -Other Special Functions ------------------------ - -.. autosummary:: - :toctree: generated/ - - expn -- Exponential integral. - exp1 -- Exponential integral of order 1 (for complex argument) - expi -- Another exponential integral -- Ei(x) - wofz -- Fadeeva function. - dawsn -- Dawson's integral. - shichi -- Hyperbolic sine and cosine integrals. - sici -- Integral of the sinc and "cosinc" functions. - spence -- Dilogarithm integral. - lambertw -- Lambert W function - zeta -- Riemann zeta function of two arguments. - zetac -- 1.0 - standard Riemann zeta function. - -Convenience Functions ---------------------- - -.. autosummary:: - :toctree: generated/ - - cbrt -- Cube root. - exp10 -- 10 raised to the x power. - exp2 -- 2 raised to the x power. - radian -- radian angle given degrees, minutes, and seconds. - cosdg -- cosine of the angle given in degrees. - sindg -- sine of the angle given in degrees. - tandg -- tangent of the angle given in degrees. - cotdg -- cotangent of the angle given in degrees. - log1p -- log(1+x) - expm1 -- exp(x)-1 - cosm1 -- cos(x)-1 - round -- round the argument to the nearest integer. If argument ends in 0.5 exactly, pick the nearest even integer. - -.. [+] in the description indicates a function which is not a universal -.. function and does not follow broadcasting and automatic -.. array-looping rules. - -""" - -__docformat__ = 'restructuredtext' -postpone_import = 1 diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py index ad62180e2551..4f32e6b95147 100644 --- a/scipy/stats/__init__.py +++ b/scipy/stats/__init__.py @@ -1,8 +1,323 @@ -# -# stats - Statistical Functions -# +""" +========================================== +Statistical functions (:mod:`scipy.stats`) +========================================== -from info import __doc__ +.. module:: scipy.stats + +This module contains a large number of probability distributions as +well as a growing library of statistical functions. + +Each included distribution is an instance of the class rv_continous: +For each given name the following methods are available: + +.. autosummary:: + :toctree: generated/ + + rv_continuous + rv_continuous.rvs + rv_continuous.pdf + rv_continuous.logpdf + rv_continuous.cdf + rv_continuous.logcdf + rv_continuous.sf + rv_continuous.logsf + rv_continuous.ppf + rv_continuous.isf + rv_continuous.moment + rv_continuous.stats + rv_continuous.entropy + rv_continuous.fit + rv_continuous.expect + rv_continuous.median + rv_continuous.mean + rv_continuous.var + rv_continuous.std + rv_continuous.interval + +Calling the instance as a function returns a frozen pdf whose shape, +location, and scale parameters are fixed. + +Similarly, each discrete distribution is an instance of the class +rv_discrete: + +.. autosummary:: + :toctree: generated/ + + rv_discrete + rv_discrete.rvs + rv_discrete.pmf + rv_discrete.logpmf + rv_discrete.cdf + rv_discrete.logcdf + rv_discrete.sf + rv_discrete.logsf + rv_discrete.ppf + rv_discrete.isf + rv_discrete.stats + rv_discrete.moment + rv_discrete.entropy + rv_discrete.expect + rv_discrete.median + rv_discrete.mean + rv_discrete.var + rv_discrete.std + rv_discrete.interval + +Continuous distributions +======================== + +.. autosummary:: + :toctree: generated/ + + norm -- Normal (Gaussian) + alpha -- Alpha + anglit -- Anglit + arcsine -- Arcsine + beta -- Beta + betaprime -- Beta Prime + bradford -- Bradford + burr -- Burr + cauchy -- Cauchy + chi -- Chi + chi2 -- Chi-squared + cosine -- Cosine + dgamma -- Double Gamma + dweibull -- Double Weibull + erlang -- Erlang + expon -- Exponential + exponweib -- Exponentiated Weibull + exponpow -- Exponential Power + f -- F (Snecdor F) + fatiguelife -- Fatigue Life (Birnbaum-Sanders) + fisk -- Fisk + foldcauchy -- Folded Cauchy + foldnorm -- Folded Normal + frechet_r -- Frechet Right Sided, Extreme Value Type II (Extreme LB) or weibull_min + frechet_l -- Frechet Left Sided, Weibull_max + genlogistic -- Generalized Logistic + genpareto -- Generalized Pareto + genexpon -- Generalized Exponential + genextreme -- Generalized Extreme Value + gausshyper -- Gauss Hypergeometric + gamma -- Gamma + gengamma -- Generalized gamma + genhalflogistic -- Generalized Half Logistic + gilbrat -- Gilbrat + gompertz -- Gompertz (Truncated Gumbel) + gumbel_r -- Right Sided Gumbel, Log-Weibull, Fisher-Tippett, Extreme Value Type I + gumbel_l -- Left Sided Gumbel, etc. + halfcauchy -- Half Cauchy + halflogistic -- Half Logistic + halfnorm -- Half Normal + hypsecant -- Hyperbolic Secant + invgamma -- Inverse Gamma + invgauss -- Inverse Gaussian + invweibull -- Inverse Weibull + johnsonsb -- Johnson SB + johnsonsu -- Johnson SU + ksone -- Kolmogorov-Smirnov one-sided (no stats) + kstwobign -- Kolmogorov-Smirnov two-sided test for Large N (no stats) + laplace -- Laplace + logistic -- Logistic + loggamma -- Log-Gamma + loglaplace -- Log-Laplace (Log Double Exponential) + lognorm -- Log-Normal + lomax -- Lomax (Pareto of the second kind) + maxwell -- Maxwell + mielke -- Mielke's Beta-Kappa + nakagami -- Nakagami + ncx2 -- Non-central chi-squared + ncf -- Non-central F + nct -- Non-central Student's T + pareto -- Pareto + powerlaw -- Power-function + powerlognorm -- Power log normal + powernorm -- Power normal + rdist -- R-distribution + reciprocal -- Reciprocal + rayleigh -- Rayleigh + rice -- Rice + recipinvgauss -- Reciprocal Inverse Gaussian + semicircular -- Semicircular + t -- Student's T + triang -- Triangular + truncexpon -- Truncated Exponential + truncnorm -- Truncated Normal + tukeylambda -- Tukey-Lambda + uniform -- Uniform + vonmises -- Von-Mises (Circular) + wald -- Wald + weibull_min -- Minimum Weibull (see Frechet) + weibull_max -- Maximum Weibull (see Frechet) + wrapcauchy -- Wrapped Cauchy + +Discrete distributions +====================== + +.. autosummary:: + :toctree: generated/ + + binom -- Binomial + bernoulli -- Bernoulli + nbinom -- Negative Binomial + geom -- Geometric + hypergeom -- Hypergeometric + logser -- Logarithmic (Log-Series, Series) + poisson -- Poisson + planck -- Planck (Discrete Exponential) + boltzmann -- Boltzmann (Truncated Discrete Exponential) + randint -- Discrete Uniform + zipf -- Zipf + dlaplace -- Discrete Laplacian + +Statistical functions +===================== + +Several of these functions have a similar version in scipy.stats.mstats +which work for masked arrays. + +.. autosummary:: + :toctree: generated/ + + gmean -- Geometric mean + hmean -- Harmonic mean + mean -- Arithmetic mean + cmedian -- Computed median + median -- Median + mode -- Modal value + tmean -- Truncated arithmetic mean + tvar -- Truncated variance + tmin _ + tmax _ + tstd _ + tsem _ + moment -- Central moment + variation -- Coefficient of variation + skew -- Skewness + kurtosis -- Fisher or Pearson kurtosis + describe -- Descriptive statistics + skewtest _ + kurtosistest _ + normaltest _ + +.. autosummary:: + :toctree: generated/ + + itemfreq _ + scoreatpercentile _ + percentileofscore _ + histogram2 _ + histogram _ + cumfreq _ + relfreq _ + +.. autosummary:: + :toctree: generated/ + + obrientransform + signaltonoise + bayes_mvs + sem + zmap + zscore + +.. autosummary:: + :toctree: generated/ + + threshold + trimboth + trim1 + +.. autosummary:: + :toctree: generated/ + + f_oneway + pearsonr + spearmanr + pointbiserialr + kendalltau + linregress + +.. autosummary:: + :toctree: generated/ + + ttest_1samp + ttest_ind + ttest_rel + kstest + chisquare + ks_2samp + mannwhitneyu + tiecorrect + ranksums + wilcoxon + kruskal + friedmanchisquare + +.. autosummary:: + :toctree: generated/ + + ansari + bartlett + levene + shapiro + anderson + binom_test + fligner + mood + oneway + +Contingency table functions +=========================== + +.. autosummary:: + :toctree: generated/ + + fisher_exact + chi2_contingency + contingency.expected_freq + contingency.margins + +General linear model +==================== + +.. autosummary:: + :toctree: generated/ + + glm + +Plot-tests +========== + +.. autosummary:: + :toctree: generated/ + + probplot + ppcc_max + ppcc_plot + + +Masked statistics functions +=========================== + +.. toctree:: + + stats.mstats + + +Univariate and multivariate kernel density estimation (:mod:`scipy.stats.kde`) +============================================================================== + +.. autosummary:: + :toctree: generated/ + + gaussian_kde + +For many more stat related functions install the software R and the +interface package rpy. + +""" from stats import * from distributions import * diff --git a/scipy/stats/info.py b/scipy/stats/info.py deleted file mode 100644 index b11d60fae34d..000000000000 --- a/scipy/stats/info.py +++ /dev/null @@ -1,326 +0,0 @@ -""" -========================================== -Statistical functions (:mod:`scipy.stats`) -========================================== - -.. module:: scipy.stats - -This module contains a large number of probability distributions as -well as a growing library of statistical functions. - -Each included distribution is an instance of the class rv_continous: -For each given name the following methods are available: - -.. autosummary:: - :toctree: generated/ - - rv_continuous - rv_continuous.rvs - rv_continuous.pdf - rv_continuous.logpdf - rv_continuous.cdf - rv_continuous.logcdf - rv_continuous.sf - rv_continuous.logsf - rv_continuous.ppf - rv_continuous.isf - rv_continuous.moment - rv_continuous.stats - rv_continuous.entropy - rv_continuous.fit - rv_continuous.expect - rv_continuous.median - rv_continuous.mean - rv_continuous.var - rv_continuous.std - rv_continuous.interval - -Calling the instance as a function returns a frozen pdf whose shape, -location, and scale parameters are fixed. - -Similarly, each discrete distribution is an instance of the class -rv_discrete: - -.. autosummary:: - :toctree: generated/ - - rv_discrete - rv_discrete.rvs - rv_discrete.pmf - rv_discrete.logpmf - rv_discrete.cdf - rv_discrete.logcdf - rv_discrete.sf - rv_discrete.logsf - rv_discrete.ppf - rv_discrete.isf - rv_discrete.stats - rv_discrete.moment - rv_discrete.entropy - rv_discrete.expect - rv_discrete.median - rv_discrete.mean - rv_discrete.var - rv_discrete.std - rv_discrete.interval - -Continuous distributions -======================== - -.. autosummary:: - :toctree: generated/ - - norm -- Normal (Gaussian) - alpha -- Alpha - anglit -- Anglit - arcsine -- Arcsine - beta -- Beta - betaprime -- Beta Prime - bradford -- Bradford - burr -- Burr - cauchy -- Cauchy - chi -- Chi - chi2 -- Chi-squared - cosine -- Cosine - dgamma -- Double Gamma - dweibull -- Double Weibull - erlang -- Erlang - expon -- Exponential - exponweib -- Exponentiated Weibull - exponpow -- Exponential Power - f -- F (Snecdor F) - fatiguelife -- Fatigue Life (Birnbaum-Sanders) - fisk -- Fisk - foldcauchy -- Folded Cauchy - foldnorm -- Folded Normal - frechet_r -- Frechet Right Sided, Extreme Value Type II (Extreme LB) or weibull_min - frechet_l -- Frechet Left Sided, Weibull_max - genlogistic -- Generalized Logistic - genpareto -- Generalized Pareto - genexpon -- Generalized Exponential - genextreme -- Generalized Extreme Value - gausshyper -- Gauss Hypergeometric - gamma -- Gamma - gengamma -- Generalized gamma - genhalflogistic -- Generalized Half Logistic - gilbrat -- Gilbrat - gompertz -- Gompertz (Truncated Gumbel) - gumbel_r -- Right Sided Gumbel, Log-Weibull, Fisher-Tippett, Extreme Value Type I - gumbel_l -- Left Sided Gumbel, etc. - halfcauchy -- Half Cauchy - halflogistic -- Half Logistic - halfnorm -- Half Normal - hypsecant -- Hyperbolic Secant - invgamma -- Inverse Gamma - invgauss -- Inverse Gaussian - invweibull -- Inverse Weibull - johnsonsb -- Johnson SB - johnsonsu -- Johnson SU - ksone -- Kolmogorov-Smirnov one-sided (no stats) - kstwobign -- Kolmogorov-Smirnov two-sided test for Large N (no stats) - laplace -- Laplace - logistic -- Logistic - loggamma -- Log-Gamma - loglaplace -- Log-Laplace (Log Double Exponential) - lognorm -- Log-Normal - lomax -- Lomax (Pareto of the second kind) - maxwell -- Maxwell - mielke -- Mielke's Beta-Kappa - nakagami -- Nakagami - ncx2 -- Non-central chi-squared - ncf -- Non-central F - nct -- Non-central Student's T - pareto -- Pareto - powerlaw -- Power-function - powerlognorm -- Power log normal - powernorm -- Power normal - rdist -- R-distribution - reciprocal -- Reciprocal - rayleigh -- Rayleigh - rice -- Rice - recipinvgauss -- Reciprocal Inverse Gaussian - semicircular -- Semicircular - t -- Student's T - triang -- Triangular - truncexpon -- Truncated Exponential - truncnorm -- Truncated Normal - tukeylambda -- Tukey-Lambda - uniform -- Uniform - vonmises -- Von-Mises (Circular) - wald -- Wald - weibull_min -- Minimum Weibull (see Frechet) - weibull_max -- Maximum Weibull (see Frechet) - wrapcauchy -- Wrapped Cauchy - -Discrete distributions -====================== - -.. autosummary:: - :toctree: generated/ - - binom -- Binomial - bernoulli -- Bernoulli - nbinom -- Negative Binomial - geom -- Geometric - hypergeom -- Hypergeometric - logser -- Logarithmic (Log-Series, Series) - poisson -- Poisson - planck -- Planck (Discrete Exponential) - boltzmann -- Boltzmann (Truncated Discrete Exponential) - randint -- Discrete Uniform - zipf -- Zipf - dlaplace -- Discrete Laplacian - -Statistical functions -===================== - -Several of these functions have a similar version in scipy.stats.mstats -which work for masked arrays. - -.. autosummary:: - :toctree: generated/ - - gmean -- Geometric mean - hmean -- Harmonic mean - mean -- Arithmetic mean - cmedian -- Computed median - median -- Median - mode -- Modal value - tmean -- Truncated arithmetic mean - tvar -- Truncated variance - tmin _ - tmax _ - tstd _ - tsem _ - moment -- Central moment - variation -- Coefficient of variation - skew -- Skewness - kurtosis -- Fisher or Pearson kurtosis - describe -- Descriptive statistics - skewtest _ - kurtosistest _ - normaltest _ - -.. autosummary:: - :toctree: generated/ - - itemfreq _ - scoreatpercentile _ - percentileofscore _ - histogram2 _ - histogram _ - cumfreq _ - relfreq _ - -.. autosummary:: - :toctree: generated/ - - obrientransform - signaltonoise - bayes_mvs - sem - zmap - zscore - -.. autosummary:: - :toctree: generated/ - - threshold - trimboth - trim1 - -.. autosummary:: - :toctree: generated/ - - f_oneway - pearsonr - spearmanr - pointbiserialr - kendalltau - linregress - -.. autosummary:: - :toctree: generated/ - - ttest_1samp - ttest_ind - ttest_rel - kstest - chisquare - ks_2samp - mannwhitneyu - tiecorrect - ranksums - wilcoxon - kruskal - friedmanchisquare - -.. autosummary:: - :toctree: generated/ - - ansari - bartlett - levene - shapiro - anderson - binom_test - fligner - mood - oneway - -Contingency table functions -=========================== - -.. autosummary:: - :toctree: generated/ - - fisher_exact - chi2_contingency - contingency.expected_freq - contingency.margins - -General linear model -==================== - -.. autosummary:: - :toctree: generated/ - - glm - -Plot-tests -========== - -.. autosummary:: - :toctree: generated/ - - probplot - ppcc_max - ppcc_plot - - -Masked statistics functions -=========================== - -.. toctree:: - - stats.mstats - - -Univariate and multivariate kernel density estimation (:mod:`scipy.stats.kde`) -============================================================================== - -.. autosummary:: - :toctree: generated/ - - gaussian_kde - -For many more stat related functions install the software R and the -interface package rpy. - -""" - -postpone_import = 1 -global_symbols = ['find_repeats'] - -depends = ['linalg','special'] -ignore = False diff --git a/scipy/weave/__init__.py b/scipy/weave/__init__.py index 269dc7fcabaa..c966c88ca618 100644 --- a/scipy/weave/__init__.py +++ b/scipy/weave/__init__.py @@ -1,8 +1,13 @@ -# -# weave - C/C++ integration -# +""" +C/C++ integration +================= + + inline -- a function for including C/C++ code within Python + blitz -- a function for compiling Numeric expressions to C++ + ext_tools -- a module that helps construct C/C++ extension modules. + accelerate -- a module that inline accelerates Python functions +""" -from info import __doc__ from weave_version import weave_version as __version__ try: diff --git a/scipy/weave/info.py b/scipy/weave/info.py deleted file mode 100644 index 346164db2452..000000000000 --- a/scipy/weave/info.py +++ /dev/null @@ -1,12 +0,0 @@ -""" -C/C++ integration -================= - - inline -- a function for including C/C++ code within Python - blitz -- a function for compiling Numeric expressions to C++ - ext_tools -- a module that helps construct C/C++ extension modules. - accelerate -- a module that inline accelerates Python functions -""" -postpone_import = 1 -standalone = 1 -ignore = 1