summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* MAINT: Look up typeinfo properties by name, not by indexEric Wieser2017-12-061-10/+11
|
* MAINT: Use a StructSequence in place of the typeinfo tuplesEric Wieser2017-12-061-1/+1
| | | | This makes the contents of `typeinfo` look liked namedtuples
* TST: Test f2py passing string array to callback.Charles Harris2017-11-151-2/+32
| | | | See #10027.
* DEP, ENH: deprecate UPDATEIFCOPY (except for nditer) and replace with ↵Matti Picus2017-11-082-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WRITEBACKIFCOPY (#9639) * ENH: add API to resolve UPDATEONCOPY outside dealloc, test and use * BUG: Fix usage of keyword "from" as argument name for "can_cast". Also removed inconsistency between the second argument name between documentation ("totype") and code ("to"). * UPDATEIFCOPY -> WRITEBACKIFCOPY, documentation * fixes for review * review2, fix new test * fix new test for using self.assert_deprecated * change deprecation logic as per review * new logic exposed places where PyArray_ResolveWritebackIfCopy not called * deprecate PyArray_XDECREF_ERR in favor of PyArray_DiscardWritebackIfCopy * code review changes * clean up merge cruft * fix from review * fixes from review * extend the release note
* TST: callback: update commentxoviat2017-09-091-1/+1
|
* TST: block docstring: update commentxoviat2017-09-091-1/+1
|
* TST: common: update documentationxoviat2017-09-091-1/+1
|
* TST: util: update documentationxoviat2017-09-091-1/+1
|
* TST: fix failures:xoviat2017-09-044-7/+13
| | | | | | 1. fail tests related to DLL load failure as they were previously untested. 2. fix have_compiler to return false on old compilers 3. xfail some tests that were not working on old Python versions.
* [TST] slightly simplify f2py testNico Schlömer2017-08-291-2/+1
|
* [TST] fix test for 0-sized array operationsNico Schlömer2017-08-281-2/+3
|
* [TST] add tests for 0-sized Fortran arraysNico Schlömer2017-08-281-0/+9
|
* TST, MAINT: Add `__init__.py` files to tests directories.Charles Harris2017-08-0617-16/+16
| | | | | | | | This allows pytest to run with duplicate test file names. Note that `python <path-to-test-file>` no longer works with this change, nor will a simple `pytest numpy`, because numpy is imported from the numpy repository. However, `python runtests.py` and `>>> numpy.test()` are still available.
* TST: Remove unittest dependencies in numpy/f2py/tests.Charles Harris2017-07-242-9/+7
|
* TST: test doc string of COMMON block arrays for numpy.f2py.Bob Eldering2017-07-071-0/+23
|
* TST: add test case described in ticket 9228 for numpy.f2pyBob Eldering2017-06-132-0/+37
|
* TST: add a char array input testJulian Taylor2017-05-022-0/+55
|
* MAINT: Remove asbytes where a b prefix would sufficeEric Wieser2017-03-252-11/+10
| | | | | | | | Since we only need to support python 2, we can remove any case where we just pass a single string literal and use the b prefix instead. What we can't do is transform asbytes("tests %d" % num), because %-formatting fails on bytes in python 3.x < 3.5.
* TST: adding test for constants without compound kind specjutke2017-01-202-0/+31
| | | | | | | This augments the test in constant_compound.f90 by using constants without a compound kind spec to illustrate the case that led to the reporting of issue #8493
* TST: adding tests for compound constant provided by @zerothijutke2017-01-202-0/+27
| | | | | This is a test code provided as a patch by @zerothi checking the compound constant parsing.
* BUG: fixed kind specifications for parametersNick Papior2016-11-275-3/+206
| | | | | | | | | | | | | Fortran sources with parameters having kind-specifiers where not correctly intercepted in the crackfortran.py source. The reason was a restrictive check for only integer specifiers which did not split real's into the correct number. Furthermore, several tests has been added which tests the different kind specifiers and their use in codes, also all of them together. Signed-off-by: Nick Papior <nickpapior@gmail.com>
* 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
|