summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests/test_array_from_pyobj.py
Commit message (Collapse)AuthorAgeFilesLines
* ENH: Support character string arraysPearu Peterson2022-06-051-11/+70
| | | | | | | | | | | | | | | | TST: added test for issue #18684 ENH: f2py opens files with correct encoding, fixes #635 TST: added test for issue #6308 TST: added test for issue #4519 TST: added test for issue #3425 ENH: Implement user-defined hooks support for post-processing f2py data structure. Implement character BC hook. ENH: Add support for detecting utf-16 and utf-32 encodings.
* DEP: remove NPY_ARRAY_UPDATEIFCOPY, deprecated in 1.14 (#20589)Matti Picus2021-12-181-1/+0
| | | | | | | | | | | | | * DEP: remove NPY_ARRAY_UPDATEIFCOPY, deprecated in 1.14 * remove more UPDATEIFCOPY * typo: add missing comma * remove a few more UPDATEIFCOPY * Add release note * remove UPDATEIFCOPY from comment (from review)
* MAINT,TST: Reduce np.testing to IS_PYPYRohit Goswami2021-12-061-130/+104
| | | | Co-authored-by: Melissa Weber Mendonça <melissawm@gmail.com>
* MAINT: Update to better python stylesRohit Goswami2021-12-051-14/+14
| | | | Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com>
* MAINT: Rework whitespace to pass PR checksRohit Goswami2021-12-051-163/+222
| | | | Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
* TST,STY: Clean up F2PY tests for pathlib.PathRohit Goswami2021-12-031-4/+3
|
* TST: Skip f2py TestSharedMemory for LONGDOUBLE on macos/arm64Olivier Grisel2021-04-271-1/+5
| | | | LONGDOUBLE is an alias for DOUBLE on this platform.
* ENH: Share memory of read-only intent(in) arrays. Closes #16347Pearu Peterson2021-02-071-0/+13
|
* DEP: Deprecate `data_type.dtype` if attribute is not already a dtype (#13578)Sebastian Berg2021-01-061-42/+42
| | | | | | * DEP: Deprecate `data_type.dtype` if attribute is not already a dtype After the deprecation, a recursive lookup for `.dtype` will not be possible, since `.dtype` has to be a dtype instance.
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-5/+5
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* MAINT: remove duplicate importsmattip2018-09-261-2/+0
|
* Merge pull request #11894 from QuLogic/f2py-test-parametrizeCharles Harris2018-09-221-11/+9
|\ | | | | TST: Parametrize f2py tests.
| * TST: Use fixture around f2py shared memory tests.Elliott Sales de Andrade2018-09-061-11/+9
| | | | | | | | | | This allows to parametrize the entire class without having to do any trickery with eval.
* | BUG: Fix missing pytest import.Charles Harris2018-09-211-0/+1
| | | | | | `test_array_from_pyobj.py` needs to import pytest.
* | TST: prefer pytest.skip() over SkipTestTyler Reddy2018-09-211-2/+2
|/ | | | | | | | | | | | * replace most usage of SkipTest() with pytest.skip() * where possible, we avoid use of the standard library SkipTest because unittest skipping is routed through the pytest nose compatibility layer in that scenario, which can prevent an easy trace back to the test line where the skip occurred
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-061-8/+2
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* 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
* DEP, ENH: deprecate UPDATEIFCOPY (except for nditer) and replace with ↵Matti Picus2017-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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, MAINT: Add `__init__.py` files to tests directories.Charles Harris2017-08-061-1/+1
| | | | | | | | 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-241-8/+6
|
* ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-161-4/+2
| | | | | | | | * 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-251-1/+1
|
* STY: PEP8 and pyflakes fixes for numpy/f2py/tests.Charles Harris2015-07-251-89/+123
|
* 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.
* 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-181-141/+141
| | | | | | | 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 `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-081-27/+27
| | | | | | | | | | | | 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-061-1/+1
| | | | | | | 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-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+2
| | | | | | | | 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-261-6/+6
| | | | Example: except ValueError,msg: -> except ValueError as msg:
* STY: f2py - replace macros in old_defines.h with new.Charles Harris2012-02-041-1/+1
|
* 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-051-2/+2
|
* BUG: Fixed ticket #1767. Replaced assert with assert_ calls.Pearu Peterson2011-03-111-96/+99
|
* 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-061-0/+535
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.