summaryrefslogtreecommitdiff
path: root/numpy/f2py
Commit message (Collapse)AuthorAgeFilesLines
...
* MAINT: Misc. typos (#11005)luzpaz2018-04-301-1/+1
| | | | | | | | | User- and non-user-facing typos. Some source typos fixes as well. Found via `codespell`.
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-0617-77/+19
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* TST: Update modules `test` to PytestTester.Charles Harris2018-04-041-2/+3
| | | | | | | | Numpy can now be tested using the standard `python -c"import numpy; numpy.test()"` construct.
* TST: Switch to using pytest markersCharles Harris2018-04-0417-61/+88
| | | | | | | | | | | Use standard pytest markers everywhere in the numpy tests. At this point there should be no nose dependency. However, nose is required to test the legacy decorators if so desired. At this point, numpy test cannot be run in the way with runtests, rather installed numpy can be tested with `pytest --pyargs numpy` as long as that is not run from the repo. Run it from the tools directory or some such.
* MAINT: Remove "bench" from testing modules `__init__`s.Charles Harris2018-03-311-1/+0
| | | | | The "bench" testing with the old bench files is no longer supported. These days we use `runtests.py` and `asv`.
* DOC: Fix minor typosluz.paz2018-03-301-1/+1
| | | Found via `codespell -q 3 -I ../numpy-whitelist.txt`
* MAINT: Fixed C++ guard in f2py test.siavashserver2018-03-091-2/+2
|
* MAINT: Hard tab and whitespace cleanup.Charles Harris2018-03-084-74/+75
|
* TST: test handling ';' in multiline and enhancement lines, numpy.f2pyBob Eldering2018-03-081-0/+53
| | | | | | Regression tests for bug discussed in pull request #10676. Lines matching the multiline or f2py enhancement pattern should not be split by ';'.
* BUG: fix for splitting a multiline or enhancement by ';' in numpy.f2py.Bob Eldering2018-03-081-2/+3
| | | | | | The variable line was assigned to before checking whether it contains a multiline or f2py enhancement pattern. In these cases the line should not be split by ';'. See pull request #10676.
* BUG: F2py mishandles quoted control characters (#10676)bobeldering2018-03-042-37/+79
| | | | | | | | | | | | | | | | | * BUG: improve parsing of quoted control characters in numpy.f2py. See #10634. Fixes a couple of cases where quoted control characters are parsed as if they are unquoted. The control characters considered are "()!;". * TST: quoted characters parsing by numpy.f2py. Basic test of parsing quoted Fortran control characters. See #10634. * BUG: add missing space character when reconstructing fortran line. The missing space caused a line starting with "!f2py" to be considered a continuation line.
* BUG: f2py: fix f2py generated code to work on PypyPauli Virtanen2018-02-241-5/+25
| | | | | | | | F2py generates code that uses PyTuple_SetItem on a tuple that has been "used", which is invalid on Pypy. Add #ifdefs that make the generated code convert the object to a list, use PyList_SetItem, and then convert it back to a tuple.
* Misc. typosluz.paz2018-02-161-1/+1
| | | | | | | | | | | | | | | | | | | Found via `codespell -q 3 -I ../numpy-whitelist.txt` Whitelist consists of: ``` amin ans behaviour cancellation dum initialise ith nd ot splitted writeable ``` .
* Merge pull request #10154 from eric-wieser/fixup-numerictypesCharles Harris2018-01-041-11/+12
|\ | | | | MAINT: Use a StructSequence in place of the typeinfo tuples
| * 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
* | DOC: fix minor typosUnknown2017-12-124-7/+7
|/
* TST: Test f2py passing string array to callback.Charles Harris2017-11-151-2/+32
| | | | See #10027.
* BUG: Fix f2py string variables in callbacks.Charles Harris2017-11-151-2/+6
| | | | | | | | | | | When NPY_CHAR was deprecated and replaced by NPY_STRING in f2py, calls to PyArray_New that previously relied on the type to get the itemsize needed the size explicitly specified, but that modification was missed in some of the code. Because the strings that replacee the 'c' type are always 'S1', we use an itemsize of 1 for the string types and pass it explicitly. Closes #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
* Merge pull request #9645 from xoviat/appveyorCharles Harris2017-09-304-7/+13
|\ | | | | ENH: enable OpenBLAS on windows.
| * 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.
* | 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
|