ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ ]c@`sdZddlmZmZmZddlZddlZddlZddlm Z ddl Z ddl m Z mZdZeedZd efd YZd ZdS( se Nose test running. This module implements ``test()`` and ``bench()`` functions for NumPy modules. i(tdivisiontabsolute_importtprint_functionN(t basestringi(t import_nosetsuppress_warningscC`s|}g}xQd|ks(d|kr`tjj|\}}|dkrPPn|j|qW|s~d|krwdSdSn|j|djdr|jdndj|S( s& Given a path where a package is installed, determine its name. Parameters ---------- filepath : str Path to a file. If the determination fails, "numpy" is returned. Examples -------- >>> np.testing.nosetester.get_package_name('nonsense') 'numpy' s site-packagess dist-packagestscipytnumpyis.eggt.(s site-packagess dist-packages(tostpathtsplittappendtreversetendswithtpoptjoin(tfilepathtfullpathtpkg_nametp2((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pytget_package_names   cC`s|dkrHtjd}|jjdd}|dkrHtqHn|dkrgtj|g}n ||g}t}ddlm }|j d|d|gdS(s Run a test module. Equivalent to calling ``$ nosetests `` from the command line Parameters ---------- file_to_run : str, optional Path to test module, or None. By default, run the module from which this function is called. argv : list of strings Arguments to be passed to the nose test runner. ``argv[0]`` is ignored. All command line arguments accepted by ``nosetests`` will work. If it is the default value None, sys.argv is used. .. versionadded:: 1.9.0 Examples -------- Adding the following:: if __name__ == "__main__" : run_module_suite(argv=sys.argv) at the end of a test module will run the tests when that module is called in the python interpreter. Alternatively, calling:: >>> run_module_suite(file_to_run="numpy/tests/test_matlib.py") from an interpreter will run all the test routine in 'test_matlib.py'. it__file__(tKnownFailurePlugintargvt addpluginsN( tNonetsyst _getframetf_localstgettAssertionErrorRRt noseclassesRtrun(t file_to_runRtftnoseR((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pytrun_module_suite;s#      t NoseTestercB`seZdZd dddZdZdZdZddd eed Z ddd eed d Z ddd d Z RS( s Nose test runner. This class is made available as numpy.testing.Tester, and a test function is typically added to a package's __init__.py like so:: from numpy.testing import Tester test = Tester().test Calling this test function finds and runs all tests associated with the package and all its sub-packages. Attributes ---------- package_path : str Full path to the package to test. package_name : str Name of the package to test. Parameters ---------- package : module, str or None, optional The package to test. If a string, this should be the full path to the package. If None (default), `package` is set to the module from which `NoseTester` is initialized. raise_warnings : None, str or sequence of warnings, optional This specifies which warnings to configure as 'raise' instead of being shown once during the test execution. Valid strings are: - "develop" : equals ``(Warning,)`` - "release" : equals ``()``, don't raise on any warnings. Default is "release". depth : int, optional If `package` is None, then this can be used to initialize from the module of the caller of (the caller of (...)) the code that initializes `NoseTester`. Default of 0 means the module of the immediate caller; higher values are useful for utility routines that want to initialize `NoseTester` objects on behalf of other code. treleaseicC`s|dkrd}nd}|dkrtjd|}|jjdd}|dkrdtntjj|}|jjdd}nKt |t trtjj|j }t |dd}n t |}||_|dkrt|}n||_||_dS(NR'iRt__name__(RRRRRRR R tdirnamet isinstancettypeRtgetattrtstrt package_pathRt package_nametraise_warnings(tselftpackageR0tdepthR/R#R.((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pyt__init__s&         cC`st|jdg}|rj|dkrjt|tsBtdn|dkrWd}n|d|g7}n|dt|g7}|dg7}|r||7}n|S( s Generate argv for nosetest command Parameters ---------- label : {'fast', 'full', '', attribute identifier}, optional see ``test`` docstring verbose : int, optional Verbosity value for test outputs, in the range 1-10. Default is 1. extra_argv : list, optional List with any extra arguments to pass to nosetests. Returns ------- argv : list command line arguments that will be passed to nose s-stfulls"Selection label should be a stringtfastsnot slows-As --verbositys--exe(RR.R*Rt TypeErrorR-(R1tlabeltverboset extra_argvR((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pyt _test_argvs    cC`st}ddl}td|j|jdddjj}td|tjj |j }td|d |j krddl }td |jtjj |j }td |nt jjd d }td|td|jdS(NisNumPy version %si itordertCs&NumPy relaxed strides checking option:sNumPy is installed in %sRsSciPy version %ssSciPy is installed in %ss tsPython version %ssnose version %d.%d.%d(i i(RRtprintt __version__tonestflagst f_contiguousR R R)RR/RRtversiontreplacet__versioninfo__(R1R$Rtrelaxed_stridestnpdirRtspdirt pyversion((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pyt_show_system_infos    cC`sddlm}|S(s Return instantiated plugin for doctests Allows subclassing of this class to override doctester A return value of None means use the nose builtin doctest plugin i(t NumpyDoctest(R RL(R1RL((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pyt_get_custom_doctestersR6icC`sKt|j|||}|rB|d|jdddg7}nddl}ddlm}m} |g} | g|jjjD]} | ^q7} d |k} |t kr| rt }n|j } | dkr|rA| rA|d g7}qAnI| r|j d n| | d | g7} |rA|d | jg7}n|| fS( s Run tests for module using nose. This method does the heavy lifting for the `test` method. It takes all the same arguments, for details see `test`. See Also -------- test s--cover-package=%ss--with-coverages --cover-testss --cover-eraseiNi(Rt Unpluggers--with-doctesttdoctests--with-(RR;R/tnose.plugins.builtinR RRNtpluginstbuiltintFalsetTrueRMRtremovetname(R1R8R9R:tdocteststcoverageRR$RRNRQtpt doctest_argvtplug((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pytprepare_test_argss,  )     c C`st|d}ddlm}||_|rBtd|jntd|j|jddl}d|_ |dkr|j }nt dt fd d$} t |tr| |}ntd } tjtjd x!|D]} tjd d | qW| jdd| jdd| jdd| jd tj| jdd| jddtj"tjd ddlm} WdQX| jd td| tjjdkrPtjrPddl} | jt dd| | jt dd| jt dd| jt dd| jt dd| jt ddntjdddd t dddd l!m"}|j#|||||\}}|d!|d"t$d#|}WdQX|j%S(%s Run tests for module using nose. Parameters ---------- label : {'fast', 'full', '', attribute identifier}, optional Identifies the tests to run. This can be a string to pass to the nosetests executable with the '-A' option, or one of several special values. Special values are: * 'fast' - the default - which corresponds to the ``nosetests -A`` option of 'not slow'. * 'full' - fast (as above) and slow tests as in the 'no -A' option to nosetests - this is the same as ''. * None or '' - run all tests. attribute_identifier - string passed directly to nosetests as '-A'. verbose : int, optional Verbosity value for test outputs, in the range 1-10. Default is 1. extra_argv : list, optional List with any extra arguments to pass to nosetests. doctests : bool, optional If True, run doctests in module. Default is False. coverage : bool, optional If True, report coverage of NumPy code. Default is False. (This requires the `coverage module: `_). raise_warnings : None, str or sequence of warnings, optional This specifies which warnings to configure as 'raise' instead of being shown once during the test execution. Valid strings are: - "develop" : equals ``(Warning,)`` - "release" : equals ``()``, don't raise on any warnings. The default is to use the class initialization value. Returns ------- result : object Returns the result of running the tests as a ``nose.result.TextTestResult`` object. Notes ----- Each NumPy module exposes `test` in its namespace to run all tests for it. For example, to run all tests for numpy.lib: >>> np.lib.test() #doctest: +SKIP Examples -------- >>> result = np.lib.test() #doctest: +SKIP Running unit tests for numpy.lib ... Ran 976 tests in 3.933s OK >>> result.errors #doctest: +SKIP [] >>> result.knownfail #doctest: +SKIP [] ii(tutilss&Running unit tests and doctests for %ssRunning unit tests for %siNtdevelopR'tlocationtalwaysterrortcategorytmessagesNot importing directorysnumpy.dtype size changedsnumpy.ufunc size changeds.*boolean negative.*s.*boolean subtract.*i(tcpuinfotmodules(sys\.exc_clear\(\) not supported in 3\.xsin 3\.x, __setslice__sin 3\.x, __getslice__s buffer\(\) not supported in 3\.xs%CObject type is not supported in 3\.xs-comparing unequal types not supported in 3\.xtignores.*getargspec.*snose\.(tNumpyTestProgramRtexitRQ((&tminR>R]R9R?R/RKRORtmasterR0tdicttWarningR*RRtwarningst resetwarningstfilterwarningstfiltertnptModuleDeprecationWarningtcatch_warningst simplefiltert distutilsRdt UserWarningRt version_infotmajort py3kwarningt threadingtDeprecationWarningR RgR\RStresult(R1R8R9R:RWRXR0R]ROt _warn_optstsupt warningtypeRdRzRgRRQtt((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pyttest+s`A               !cC`std|j|j|j|||}|ddtjg7}t}ddlm}|dg}|j d|d|S( s Run benchmarks for module using nose. Parameters ---------- label : {'fast', 'full', '', attribute identifier}, optional Identifies the benchmarks to run. This can be a string to pass to the nosetests executable with the '-A' option, or one of several special values. Special values are: * 'fast' - the default - which corresponds to the ``nosetests -A`` option of 'not slow'. * 'full' - fast (as above) and slow benchmarks as in the 'no -A' option to nosetests - this is the same as ''. * None or '' - run all tests. attribute_identifier - string passed directly to nosetests as '-A'. verbose : int, optional Verbosity value for benchmark outputs, in the range 1-10. Default is 1. extra_argv : list, optional List with any extra arguments to pass to nosetests. Returns ------- success : bool Returns True if running the benchmarks works, False if an error occurred. Notes ----- Benchmarks are like tests, but have names starting with "bench" instead of "test", and can be found under the "benchmarks" sub-directory of the module. Each NumPy module exposes `bench` in its namespace to run all benchmarks for it. Examples -------- >>> success = np.lib.bench() #doctest: +SKIP Running benchmarks for numpy.lib ... using 562341 items: unique: 0.11 unique1d: 0.11 ratio: 1.0 nUnique: 56230 == 56230 ... OK >>> success #doctest: +SKIP True sRunning benchmarks for %ss--matchs(?:^|[\\b_\\.%s-])[Bb]enchi(RNRORR( R?R/RKR;R tsepRR RNR!(R1R8R9R:RR$RNt add_plugins((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pytbenchs8  N( R(t __module__t__doc__RR4R;RKRMRSR\RR(((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pyR&ns)% %  * cC`s@ttdr'dtjkr'd}nd}td|ddS(NR@s.dev0R^R'R0R3i(thasattrRqR@R&(tmode((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pyt _numpy_testers (Rt __future__RRRR RRmt numpy.compatRRRqR]RRRRR%tobjectR&R(((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/testing/nosetester.pyts     )3