summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_format.py
Commit message (Collapse)AuthorAgeFilesLines
* ENH: Faster numpy.load (try/except _filter_header) (#22916)Michael2023-01-131-1/+2
| | | | | | | This pull requests speeds up numpy.load. Since _filter_header is quite a bottleneck, we only run it if we must. Users will get a warning if they have a legacy Numpy file so that they can save it again for faster loading. Main discussion and benchmarks see #22898 Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* BLD: update OpenBLAS to 0.3.21 and clean up openblas download test (#22525)Matti Picus2022-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * BUILD: update OpenBLAS to 0.3.21 and clean up openblas download test * set LDFLAGS on windows64 like the openblaslib build does * use rtools compilers on windows when building wheels * fix typos * add rtools gfortran to PATH * use the openblas dll from the zip archive without rewrapping * typos * copy dll import library for 64-bit interfaces * revert many of the changes to azure-steps-windows.yaml, copy openblas better in wheels * fix wildcard copy * test OpenBLAS build worked with threadpoolctl * typos * install threadpoolctl where needed, use for loop to recursively copy * update macos OpenBLAS suffixes for newer gfortran hashes * use libgfortran5.dylib on macos * fix scripts * re-use gfortran install from MacPython/gfortran-install on macos * use pre-release version of delocate * fixes for wheel builds/tests * add debugging cruft for pypy+win, macos wheels * add DYLD_LIBRARY_PATH on macosx-x86_64 * use 32-bit openblas interfaces for ppc64le tests * skip large_archive test that sometimes segfaults on PyPy+windows
* TST: Skip tests that are not currently supported in wasmHood Chatham2022-11-111-1/+4
|
* MAINT: remove u-prefix for former Unicode strings (#22479)Mike Taves2022-10-261-2/+2
|
* Merge pull request #22393 from seberg/npy_headerMatti Picus2022-10-071-3/+44
|\ | | | | MAINT: Ensure graceful handling of large header sizes
| * MAINT: Ensure graceful handling of large header sizesSebastian Berg2022-10-061-3/+44
| | | | | | | | | | | | | | | | | | This ensures graceful handling of large header files. Unfortunately, it may be a bit inconvenient for users, thus the new kwarg and the work-around of also accepting allow-pickle. See also the documation here: https://docs.python.org/3.10/library/ast.html#ast.literal_eval
* | add spare space for growth for .npy filesMichael Siebert2022-09-261-6/+21
|/
* ENH: Optimize `np.empty` for scalar arguments (#20175)Francesco Andreuzzi2022-05-061-1/+3
| | | | | | | | Optimizes the parsing of shape tuples and integers by avoiding multiple conversions and generally refactoring the code. Closes gh-19010, that parsing a single integer was very slow (due to trying to convert it to a squence twice). Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* TST: Make `test_large_archive` robust against memory issues [wheel build]Sebastian Berg2022-05-021-2/+7
|
* MAINT: remove unused importsAlessia Marcolini2021-10-081-2/+0
|
* MAINT: use super() as described by PEP 3135Mike Taves2021-03-191-1/+1
|
* TST: avoid refcount semantics, speed up testsMatti Picus2020-11-111-85/+56
|
* TST: fix tests for windows + PyPymattip2020-07-301-16/+25
|
* BUG: np.load does not handle empty array with an empty descr (#15397)Sha Liu2020-01-271-1/+3
| | | | | | | The bug occurs since numpy 1.16. Before that empty descr corresponds to `np.dtype([])`. This fixes the problem by following numpy 1.15's behavior. Closes gh-15396
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-151-36/+23
|
* 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.
* BUG: warn when saving dtype with metadata (#14994)Matti Picus2019-12-021-0/+30
| | | Address gh-14142 for the 1.18 release: warn when saving a dtype with metadata that cannot be loaded.
* Merge branch 'master' into npy-2.1Matti Picus2019-05-191-0/+56
|\
| * MAINT: remove uneeded codemattip2019-05-111-9/+20
| |
| * BUG: parse more subarrays in descr_to_dtypemattip2019-05-031-0/+44
| |
| * BUG: handle subarrays in descr_to_dtypemattip2019-04-301-0/+1
| |
* | BUG/ENH: Create npy format 3.0Eric Wieser2019-05-071-0/+25
|/ | | | | | | | This version encodes the dtype as utf8 instead of latin1. Unfortunately we need to create a new version to make this change, because we did not limit ourselves to ASCII in versions 1 and 2. Fixes gh-7391
* BUG: load fails when using pickle without allow_pickle=TruePaul Ivanov2019-04-161-6/+9
| | | | | | a partial mitigation of #12759. see also https://nvd.nist.gov/vuln/detail/CVE-2019-6446
* MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) ↵Roman Yurchak2018-12-061-1/+0
| | | | | | | | | | | | (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments
* BUG: fix for titles, cleanup, fixes from reviewmattip2018-11-131-1/+5
|
* BUG: test, fix loading structured dtypes with paddingmattip2018-11-131-1/+20
|
* TST: prefer pytest.skip() over SkipTestTyler Reddy2018-09-211-4/+4
| | | | | | | | | | | | * 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
* TST: Replace calls to unittest.TestCase.fail (#11933)Roman Yurchak2018-09-121-6/+4
| | | | | | | | After the pytest migration, test classes no longer inherit from unittest.TestCase and and the fail method does not exist anymore. In all these cases, we can use assert_raises and assert_raises_regex instead
* Merge pull request #11522 from jzwinck/fix-load-empty-npzJulian Taylor2018-07-291-0/+7
|\ | | | | BUG: fix np.load() of empty .npz file
| * BUG: fix np.load() of empty .npz fileJohn Zwinck2018-07-071-0/+7
| | | | | | | | Fixes #9989
* | DOC: link to TESTS.rst.txt testing guidelines document, tweak testing docsmattip2018-06-251-1/+1
|/
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-061-6/+1
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* TST: Switch to using pytest markersCharles Harris2018-04-041-6/+8
| | | | | | | | | | | 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: cleanup yield testsxoviat2018-01-061-6/+6
|
* ENH: Align data in np.save() at 64 bytes (#9025)John Zwinck2017-09-131-0/+7
| | | | | | | | | | | | | Previously, saving format version 1 would align to 16 bytes, and saving version 2 would align improperly (bug #8085). Alignment is now always at least 64 bytes in either version, which supports memory mapping of the saved files on Linux, where mmap() offset must be a multiple of the page size. Why 64 bytes? Simply because we don't know of a case where more is needed. AVX alignment is 32 bytes; AVX-512 is 64. Fixes #8085, closes #8598.
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-1/+1
| | | | Bare except is very rarely the right thing
* MAINT: Stop using sixu instead of a u prefixEric Wieser2017-03-251-2/+1
|
* MAINT: Remove asbytes_nested where b prefixes would sufficeEric Wieser2017-03-251-18/+18
|
* MAINT: Remove asbytes where a b prefix would sufficeEric Wieser2017-03-251-4/+4
| | | | | | | | 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.
* MAINT: Other cleanup Python < 2.7 and Python3 < 3.4Alexandr Shadchin2016-12-091-11/+0
|
* TST: mark two tests in numpy.lib as slow, speeds up numpy.lib tests by 5xRalf Gommers2016-05-161-0/+1
|
* TST: fix test error when saving large array with savez.Ralf Gommers2016-05-161-2/+9
|
* BUG: Cast size to int64 when loading from archivedrasmuss2016-05-091-0/+14
| | | | | Prevents overflow errors for large arrays on systems where the default int type is int32.
* DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-191-1/+1
| | | | Closes gh-6863.
* ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-161-2/+1
| | | | | | | | * 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
* ENH: add options for disabling use of pickle in load/savePauli Virtanen2015-04-181-0/+16
|
* TST: tests for format.read_array_header_* and test read_magicBlake Griffith2015-04-011-0/+44
|
* STY: fold long linesPauli Virtanen2015-03-081-2/+2
|
* BUG: enable working around pickle compatibility issues on Py3 in npy filesPauli Virtanen2015-03-081-1/+66
| | | | | | Add pickle compatibility flags to numpy.save and numpy.load. Allow only combinations that cannot corrupt binary data in Numpy arrays. Use the same default values as Python pickle.
* Merge pull request #5178 from charris/fix-npz-header-incompatibilityJulian Taylor2014-10-131-0/+10
|\ | | | | Fix npz header incompatibility