summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Simplify some tests using temppath context manager.Charles Harris2015-12-261-20/+12
| | | | | | | | | | | | | | | | | | | | | | | | This replaces code of the pattern ``` fd, name = tempfile.mkstemp(...) os.close(fd) try: do stuff with name finally: os.remove(name) ``` with ``` with temppath() as name: do stuff with name ``` A few more complicated cases are also handled. The remains some particularly gnarly code the could probably be refactored to use temppath, but that is a more demanding project.
* ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-162-9/+6
| | | | | | | | * use SkipTest in numpy tests instead of importing it from nose * add a KnownFailureException as an alias for KnownFailureTest (the former is preferred, but the latter is kept for backcompat) * rename the KnownFailure nose plugin into KnownFailurePlugin, and keep the old name for backcompat
* STY: PEP8 fixes in numpy/f2py/tests.Charles Harris2015-07-256-24/+46
|
* STY: PEP8 and pyflakes fixes for numpy/f2py/tests.Charles Harris2015-07-2511-258/+298
|
* DEP: removed deprecated API calls from test code (wrapmodule.c)Chris Kerr2014-11-101-31/+31
|
* Merge pull request #5168 from charris/f2py-space-fixCharles Harris2014-10-102-0/+41
|\ | | | | BUG: Make f2py work with intent(in out).
| * TST: Add basic test for compiling with intent(in out).Charles Harris2014-10-092-0/+41
| | | | | | | | | | This checks that the compilation works and that the expected error is raised when non-contiguous arrays are passed as intent(in out).
* | TST: skip clongdouble alignment checks on 32 bit archesJulian Taylor2014-09-031-3/+5
| | | | | | | | | | | | turns out not only sparc is borked, skip the checks on all 32 bit arches with too large clongdouble alignments until we have an aligned allocator.
* | TST: win32 also does not provide 16 byte alignmentJulian Taylor2014-07-271-1/+1
| | | | | | | | | | mingw builds set the alignment requirement for complex doubles types to 16 byte so the tests checking the alignment flag must be disabled.
* | TST: disable tests that fail due to bad alignment on sparcJulian Taylor2014-07-021-35/+44
|/ | | | | | | (debian) sparc system malloc does not provide the alignment required by 16 byte long double types this means the inout intent cannot be satisfied and several tests fail as the alignment flag can be randomly true or fals when numpy gains an aligned allocator the tests could be enabled again.
* BUG: #4256: f2py, PyString_FromStringAndSize is undefined in Python3.Charles Harris2014-02-161-0/+24
| | | | | | | | | Use PyUString_FromStringAndSize defined in npy_3kcompat instead. Not using bytes may cause some problems, but strings seem like a better choice. As modules generated with current f2py error out, this particular use is not common and we are free to choose. Closes #4256.
* ENH: add tobytes and stop using tostring in documentationJulian Taylor2014-02-111-1/+2
| | | | | | | tostring returns bytes which are not equal to string, so provide a tobytes function alias. tostring does not emit a deprecation warning yet so rdepends do not need to check two names to support older versions of numpy without warnings.
* STY: Giant comma spacing fixup.Charles Harris2013-08-1810-235/+235
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* 2to3: Apply the `numliterals` fixer and skip the `long` fixer.Charles Harris2013-04-134-8/+12
| | | | | | | | | | | | | | | | | | | The numliterals fixer replaces the old style octal number like '01' by '0o1' removes the 'L' suffix. Octal values were previously mistakenly specified in some dates, those uses have been corrected by removing the leading zeros. Simply Removing the 'L' suffix should not be a problem, but in some testing code it looks neccesary, so in those places the Python long constructor is used instead. The 'long' type is no longer defined in Python 3. Because we need to have it defined for Python 2 it is added to numpy/compat/np3k.py where it is defined as 'int' for Python 3 and 'long' for Python 2. The `long` fixer then needs to be skipped so that it doesn't undo the good work. Closes #3074, #3067.
* 2to3: Apply `map` fixer.Charles Harris2013-04-101-2/+2
| | | | | | | | | | | | | | | | | | | In Python 3 `map` is an iterator while in Python 2 it returns a list. The simple fix applied by the fixer is to inclose all instances of map with `list(...)`. This is not needed in all cases, and even where appropriate list comprehensions may be preferred for their clarity. Consequently, this patch attempts to use list comprehensions where it makes sense. When the mapped function has two arguments there is another problem that can arise. In Python 3 map stops execution when the shortest argument list is exhausted, while in Python 2 it stops when the longest argument list is exhausted. Consequently the two argument case might need special care. However, we have been running Python3 converted versions of numpy since 1.5 without problems, so it is probably not something that affects us. Closes #3068
* 2to3: Apply `repr` fixer.Charles Harris2013-04-089-61/+61
| | | | | | | | | | | | This replaces python backtics with repr(...). The backtics were mostly used to generate strings for printing with a string format and it is tempting to replace `'%s' % repr(x)` with `'%r' % x`. That would work except where `x` happened to be a tuple or a dictionary but, because it would be significant work to guarantee that and because there are not many places where backtics are used, the safe path is to let the repr replacements stand. Closes #3083.
* 2to3: Apply `print` fixer.Charles Harris2013-04-0612-12/+12
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-2812-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-271-1/+1
| | | | | | | | | | | | | | | In python3 range is an iterator and `xrange` has been removed. This has two consequence for code: 1) Where a list is needed `list(range(...))` must be used. 2) `xrange` must be replaced by `range` Both of these changes also work in python2 and this patch makes both. There are three places fixed that do not need it, but I left them in so that the result would be `xrange` clean. Closes #3092
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-0112-0/+23
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* 2to3: apply exec fixer results.Charles Harris2013-02-281-2/+2
| | | | This changes the `exec` command to the `exec` function.
* 2to3: Use modern exception syntax.Charles Harris2013-02-262-7/+7
| | | | Example: except ValueError,msg: -> except ValueError as msg:
* TST: f2py: rewrite strings to be easier to readPauli Virtanen2012-11-172-26/+39
|
* ENH: f2py: add 'Wrapper for ...' text to the docstringPauli Virtanen2012-11-172-1/+3
|
* ENH: f2py: generate docstrings in Numpy docstring formatPauli Virtanen2012-11-172-0/+30
|
* Use PyMODINIT_FUNC and update docs accordingly.cgohlke2012-09-021-1/+1
| | | | See https://github.com/scipy/scipy/pull/279
* STY: f2py - replace macros in old_defines.h with new.Charles Harris2012-02-042-27/+27
|
* BUG: Fix two argument size support for Fortran module routines. Reverted ↵Pearu Peterson2011-05-062-0/+46
| | | | size-to-shape mapping patch and implemented two argument size function in C.
* BUG: Fix assumed shape support for module routines.Pearu Peterson2011-05-062-1/+47
|
* BUG: Fix memory leak in f2py_rout_wrap_call test.Michael Droettboom2011-05-021-1/+3
|
* STY: Update exception style, easy ones.Charles Harris2011-04-051-6/+6
|
* STY: Replace old style classes in tests with classes subclassing object.Charles Harris2011-04-052-3/+3
|
* ENH: f2py: support Fortran size function with two arguments (ticket #1765).Pearu Peterson2011-03-132-0/+43
|
* BUG: Fixed ticket #1767. Replaced assert with assert_ calls.Pearu Peterson2011-03-1110-227/+229
|
* Implemented selected_real_kind evaluation, added tests to catch processor ↵Pearu Peterson2011-02-272-0/+54
| | | | dependencies..
* Fix assumed shape support for routines that use modules. Improved ↵Pearu Peterson2011-02-275-2/+38
| | | | .f2py_f2cmap messages.
* WIP: implemented assumed shape support for Fortran subroutines.Pearu Peterson2011-02-262-5/+5
|
* WIP: added assumed shape array support to Fortran functions.Pearu Peterson2011-02-252-0/+59
|
* TST: mark slow f2py tests + add f2py test function.David Cournapeau2010-03-317-0/+13
|
* 3K: f2py: port the array_from_pyobj test module to Py3Pauli Virtanen2010-03-062-2/+27
|
* 3K: f2py: don't use test generators in the tests -- they don't really work ↵Pauli Virtanen2010-03-065-67/+26
| | | | on Nose on Py3
* BUG: f2py: fix F90 detection in the testsPauli Virtanen2010-03-061-2/+2
|
* 3K: f2py: make f2py run far enough to produce output files (they don't ↵Pauli Virtanen2010-03-061-4/+4
| | | | compile yet, though, as the C code is not Py3 compatible)
* ENH: f2py: skip also test_array_from_pyobj if no C compiler is availablePauli Virtanen2010-03-061-0/+7
|
* ENH: f2py: convert test suite to Nose formPauli Virtanen2010-03-0629-1685/+1390
| | | | | | Rewrite F2Py's test suite, so that it is run as a part of Numpy's tests. These tests require compiling extension modules on-the-fly, so I added a small helper module for that.
* BUG: Shoddy quick fix of some f2py tests so they run. The tests expose errors,Charles Harris2010-02-255-43/+95
| | | | | but the errors look like artifacts of an unfinished refactoring and partial update to support numpy.
* Remove uses of set_package_path, set_local_path, restore_path, and Alan McIntyre2008-07-051-3/+0
| | | | associated sys.path manipulations.
* Restore old test framework classes.Alan McIntyre2008-06-211-1/+1
| | | | | | | | | | | Added numpy.testing.run_module_suite to simplify "if __name__ == '__main__'" boilerplate code in test modules. Removed numpy/testing/pkgtester.py since it just consisted of an import statement after porting SciPy r4424. Allow numpy.*.test() to accept the old keyword arguments (but issue a deprecation warning when old arguments are seen). numpy.*.test() returns a test result object as before. Fixed typo in distutils doc.
* Switched to use nose to run tests. Added test and bench functions to all ↵Alan McIntyre2008-06-171-24/+25
| | | | modules.
* using faster string methods rather than deprecated string moduleJarrod Millman2007-10-291-2/+1
|