summaryrefslogtreecommitdiff
path: root/numpy/f2py
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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.
* | MAINT: remove outdated entries in f2pyBernhard M. Wiedemann2017-09-271-3/+0
| | | | | | | | because svn is not used anymore
* | ENH: Allow to override build dateBernhard M. Wiedemann2017-09-271-1/+2
| | | | | | | | | | | | | | | | and use gmtime in order to be independent of timezone in order to make builds reproducible. See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable.
* | MAINT: Use the PyArray_(GET|SET)_ITEM functions where possibleEric Wieser2017-09-231-4/+4
|/
* [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
|
* f2py: rename internal functionNico Schlömer2017-08-281-3/+3
|
* f2py: allow Fortran arrays of dimension 0Nico Schlömer2017-08-281-1/+1
| | | | | | | | | | | | Up until now, f2py throw an error when arrays were declared which had dimension of length 0. This, however, is a perfectly legal case, and in fact occurs frequently in the context of linear algrebra. This bug was discovered, for example, in an interface that does matrix tridiagonalization. If the matrix is 1x1, the super- and subdiagonal are of length 0. Note that negative dimensions continue to produce errors although Fortran also allows this (it always allocates to size max(0, n)).
* BUG: f2py: Convert some error messages printed to stderr to exceptions.Warren Weckesser2017-08-261-38/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In f2py/src/fortranobject.c, the function `check_and_fix_dimensions` does pretty much what it says on the tin: /* This function fills in blanks (that are -1\'s) in dims list using the dimensions from arr. It also checks that non-blank dims will match with the corresponding values in arr dimensions. */ There are several error conditions detected by the function. In the code before this change, when the function detected such an error, it would print a message to stderr and return 1. In this change, when an error is detected in `check_and_fix_dimensions`, an exception is set. This new feature of `check_and_fix_dimensions` is used in three places in the function `array_from_pyobj()`. In each case, there was an old comment of the form: /* XXX: set exception */ In this change, the exception is now set in `check_and_fix_dimensions()`, so those comments have been removed. For some error conditions, the new code changes the exception that is raised. For example, here's a scipy test before this change: ``` In [5]: from scipy.linalg import _fblas as fblas In [6]: a = np.array([[1., 0.], [0., -2.], [2., 3.]]) In [7]: b = np.array([[0., 1.], [1., 0.], [0, 1.]]) In [8]: fblas.dsyr2k(a=a, b=b, alpha=1.0, c=np.zeros((15, 8))) 0-th dimension must be fixed to 3 but got 15 --------------------------------------------------------------------------- error Traceback (most recent call last) <ipython-input-8-bc4d51f8d016> in <module>() ----> 1 f(a=a, b=b, alpha=1.0, c=np.zeros((15, 8))) error: failed in converting 2nd keyword `c' of _fblas.dsyr2k to C/Fortran array ``` After this change, we get: ``` In [2]: from scipy.linalg import _fblas as fblas In [3]: a = np.array([[1., 0.], [0., -2.], [2., 3.]]) In [4]: b = np.array([[0., 1.], [1., 0.], [0, 1.]]) In [5]: fblas.dsyr2k(a=a, b=b, alpha=1.0, c=np.zeros((15, 8))) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-6-bc4d51f8d016> in <module>() ----> 1 f(a=a, b=b, alpha=1.0, c=np.zeros((15, 8))) ValueError: 0-th dimension must be fixed to 3 but got 15 ``` The spurious print has been changed to the exception message, but some potentially useful information in the old exception message has been lost.
* 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.
* Merge pull request #9452 from eric-wieser/new-style-classesCharles Harris2017-07-241-1/+1
|\ | | | | MAINT: Use new-style classes on 2.7
| * MAINT: Use new-style classes on 2.7Eric Wieser2017-07-241-1/+1
| | | | | | | | Deliberately avoids tests, to prevent introducing a failure on old-style classes later.
* | Merge pull request #9434 from charris/remove-unittest-dependenciesCharles Harris2017-07-242-9/+7
|\ \ | |/ |/| Remove unittest dependencies
| * TST: Remove unittest dependencies in numpy/f2py/tests.Charles Harris2017-07-242-9/+7
| |
* | MAINT: Replace tab escapes with four spacesEric Wieser2017-07-121-500/+500
|/ | | | | Using \t here is just cryptic. Done using a very basic find and replace.
* TST: test doc string of COMMON block arrays for numpy.f2py.Bob Eldering2017-07-071-0/+23
|
* Merge pull request #9362 from charris/rearrange-testing-moduleCharles Harris2017-07-062-2/+2
|\ | | | | ENH: Rearrange testing module to isolate nose dependency.
| * MAINT: Rearrange files in numpy/testing module.Charles Harris2017-07-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim here is to separate out the nose dependent files prior to adding pytest support. This could be done by adding new files to the general numpy/testing directory, but I felt that it was to have the relevant files separated out as it makes it easier to completely remove nose dependencies when needed. Many places were accessing submodules in numpy/testing directly, and in some cases incorrectly. That presented a backwards compatibility problem. The solution adapted here is to have "dummy" files whose contents will depend on whether of not pytest is active. That way the module looks the same as before from the outside. In the case of numpy itself, direct accesses have been fixed. Having proper `__all__` lists in the submodules helped in that.
* | BUG: ')' is printed at the end pointer of the buffer in numpy.f2py.Bob Eldering2017-07-051-2/+1
|/ | | | | | | When building the __doc__ string for Fortran objects, the ')' character, closing the dimensions list, is written 1 position beyond the allowed buffer size, instead of the current pointer in the buffer.
* MAINT: Fix alerts from http://lgtm.com (#9292)Jean Helie2017-06-261-18/+16
| | | | | | | * make exception raising 2/3 compatible * remove unnecesary else statement after while loop without break clause * ensure file is always enclosed even in the event of an exception * ensure list comprehension variable does not override enclosing loop variable
* TST: add test case described in ticket 9228 for numpy.f2pyBob Eldering2017-06-132-0/+37
|
* BUG: fix missing keyword rename for common block to numpy.f2pyBob Eldering2017-06-121-1/+1
| | | | | | | A missing call to rmbadname1 in analyzecommon caused a look up of common block variables with a name in the badnames list to fail and the fall back of defaultimplicitrules to be used. See ticket 9228.
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-032-17/+17
| | | | Bare except is very rarely the right thing
* ENH: Spelling fixesVille Skyttä2017-05-091-1/+1
|
* MAINT: remove usage of NPY_CHAR from f2pyJulian Taylor2017-05-023-11/+29
|
* 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.
* BUG: fix regex of determineexprtype_re_3 in numpy/f2py/crackfortran.pyZZhaoTireless2017-03-191-2/+2
|
* BUG: PPC64el machines are POWER for FortranMatthew Brett2017-02-211-1/+2
| | | | | | Fix Fortran kind detection for PPC64el. See: gh-3424.
* STY: space around operatorjutke2017-01-231-1/+1
| | | | per request from @charris
* 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: guard against replacing constants without '_' specjutke2017-01-201-1/+2
| | | | | | | | | | | | | | | | | | fixes #8493 In the reported problem snippet the attempt to infer the type of parameter (wasize=maxiterates*2) leads to a lookup of maxiterates in the logic of get_parameters which finds and correctly assigns to 'v' the value string '50000' However, then in the logic proceds to attempt to split off any underscore-appended precision spec from v_ which yields ['50000'] because there is no underscore. Finally line v = ''.join(v_[:-1]).lower().replace(v_[-1].lower(), '') if not quarded by the newly introduced lengthtest sets v to empty because [:-1] of a list with one element yields an empty list. Subsequently the type inference by running eval on an empty string fails with the error message quoted. The introduced length check appears to correct this problem.
* DEP: Fix escaped string characters deprecated in Python 3.6.Charles Harris2016-12-141-8/+8
| | | | | | | In Python 3.6 a number of escape sequences that were previously accepted -- for instance "\(" that was translated to "\\(" -- are deprecated. To retain the previous behavior either raw strings must be used or the backslash must be properly escaped itself.
* BUG: fixed kind specifications for parametersNick Papior2016-11-276-6/+238
| | | | | | | | | | | | | 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,DOC: add to compat.py3k a function to load modules. Fix some doc for ↵bertrand2016-07-171-10/+17
| | | | f2py.compile (issue #7683)
* MAINT: Change `call_fortran` into `callfortran` in comments.Dongjoon Hyun2016-01-291-1/+1
| | | | It was committed mistakenly in #7134. `callfortran` is used a lot really.
* MAINT: Fix some typos in a code string and commentsDongjoon Hyun2016-01-273-6/+6
|
* MAINT, STY: Removed unused variable in f2py/f90mod_rules.pyrehassachdeva2016-01-071-1/+1
|
* Merge pull request #6886 from charris/use-temppathCharles Harris2016-01-021-20/+12
|\ | | | | MAINT: Simplify some tests using temppath context manager.
| * 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.
* | [TST] Refactor new raise_warnings logic for subpackage test suitesNathaniel J. Smith2015-12-301-3/+3
|/
* MAINT: Remove commented out code blocksgfyoung2015-12-201-4/+0
|
* DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-191-1/+1
| | | | Closes gh-6863.
* DOC: Some documentation fixups.Charles Harris2015-12-171-0/+2
| | | | | Add '.. versionadded:: 1.11.0' to the new `extension` parameter in f2py.compile and document it in the 1.11.0 release notes.
* BUG,ENH: Add extension parameter to f2py.compile and fix verbose.Alex Rogozhnikov2015-12-171-9/+25
| | | | | 1. Verbose parameter was ignored earlier. 2. Allowed .f90 extensions for tempfiles
* MAINT: Include from __future__ boilerplate in some files missing it.Charles Harris2015-12-051-0/+2
| | | | | Some newer *.py files are missing the `from __future__` boilerplate that helps assure Python2 and Python3 compatibility.