#!/usr/bin/python -tt #======================================================================= # General Documentation """"Good enough" routines for numerical analysis. This package of basic array manipulation and numerical analysis tools that have algorithms that are "good enough" to get the job done. This means that they only depend on other packages (there is no called C or Fortran code), that they work, but they are not optimized or tested as rigorously as in a standard library like LAPACK. These routines enable me to write more "portable" code: if I find another module that uses a substantially better algorithm than I've implemented, I can just import and call that module in the code of my gemath routine, without having to change the code of programs that call the gemath routine. All modules in this package contain only a single non-private function, of the same name as the module. All array input/outputs are plain Numeric arrays, and many functions handle missing values through the keyword argument missing. A number of functions also accept the keyword algorithm, which allows you to select which algorithm you wish to use. Of course, different algorithms have different names; however, all routines with this keyword have one algorithm named 'default', which is the default value of the algorithm keyword. The name "gemath" means "good enough mathematics" :). Some useful online help commands for the package: * help(gemath): Help for the package. A list of all modules in this package is found in the "Package Contents" section of the help output. * help(gemath.M): Details of each module "M", where "M" is the module's name. """ #----------------------------------------------------------------------- # Additional Documentation # # Package Name: # gemath # # RCS Revision Code: # $Id: __init__.py,v 1.7 2004/04/29 22:47:46 jlin Exp $ # # Modification History: # - 12 Feb 2004: Original by Johnny Lin, Computation Institute, # University of Chicago. Passed passably reasonable tests. # # Notes: # - Written for Python 2.2.2. # - Module docstrings can be tested using the doctest module. To # test, execute "python __init__.py". # - See import statements throughout for non-"built-in" packages and # modules required. # # Copyright (c) 2003-2004 by Johnny Lin. For licensing, distribution # conditions, contact information, and additional documentation see # the URL http://www.johnny-lin.com/py_pkgs/gemath/doc/. #======================================================================= #---------------- Module General Import and Declarations --------------- #- Set module version to package version: import gemath_version __version__ = gemath_version.version __author__ = gemath_version.author __date__ = gemath_version.date __credits__ = gemath_version.credits del gemath_version #- Overall imports: import MA import Numeric as N #- List of modules in package and import all the key procedures in # the submodules so they are all available to the user with a single # "from gemath import *" command. __all__ = [ "can_use_sphere" \ , "curl_2d" \ , "deriv" \ , "dindgen" \ , "findgen" \ , "gemath_version" \ , "has_close" \ , "interp" \ , "is_monotonic_decr" \ , "is_monotonic_incr" \ , "is_numeric_float" \ , "lindgen" \ , "where_close" ] import os, sys sys.path.append(os.pardir) from curl_2d import curl_2d from deriv import deriv from dindgen import dindgen from findgen import findgen from has_close import has_close from interp import interp from is_monotonic_decr import is_monotonic_decr from is_monotonic_incr import is_monotonic_incr from is_numeric_float import is_numeric_float from lindgen import lindgen from where_close import where_close #-------------------------- Main: Test Module ------------------------- #- Define additional examples for doctest to use: __test__ = {'Additional Example 1': """ import gemath """} #- Execute doctest if module is run from command line: if __name__ == "__main__": """Test the module. Tests the examples in all the module documentation strings, plus __test__. Note: To help ensure that module testing of this file works, the parent directory to the current directory is added to sys.path. """ import doctest, sys, os sys.path.append(os.pardir) doctest.testmod(sys.modules[__name__]) # ===== end file =====