summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_io.py
Commit message (Collapse)AuthorAgeFilesLines
* ENH: Allow `np.fromregex` to accept `os.PathLike` implementationsBas van Beek2021-08-161-2/+4
|
* Rm numpy.lib.npyio.mafromtxt.Ross Barnowski2021-08-051-11/+0
|
* Rm numpy.lib.npyio.ndfromtxt.Ross Barnowski2021-08-051-11/+0
|
* PERF: Speed-up common case of loadtxt()ing non-hex floats. (#19598)Antony Lee2021-08-051-0/+22
| | | | | | | | | | | | | * PERF: Speed-up common case of loadtxt()ing non-hex floats. `python runtests.py --bench bench_io` reports a ~5-10% perf gain. * TST: Add tests to check fromhex not called unintentionally. Adds regression tests to check that the logic surrounding when the default floatconv applies the fromhex conversion does not change. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* fix from reviewmattip2021-01-241-2/+5
|
* TST: raise memory limit for testmattip2021-01-221-1/+1
|
* ENH: Allow genfromtxt to unpack structured arrays (#16650)Andrew Eckart2020-09-111-1/+46
| | | | | | | | | | | | | * ENH: Allow genfromtxt to unpack structured arrays genfromtxt failed to transpose output when unpack=True and `dtype` was structured (or None). This patch resolves the issue by returning a list of arrays, as in `loadtxt`. Co-authored-by: Matti Picus <matti.picus@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* MAINT: Remove users of `numpy.compat.bytes`Eric Wieser2020-08-311-1/+1
| | | | Some more Python 2 cleanup.
* TST: fix tests for windows + PyPymattip2020-07-301-1/+8
|
* TST, BUG: Re-raise MemoryError exception in test_large_zip's process (gh-16890)Antonio Larrosa2020-07-181-8/+22
| | | | | | | | | | | | Since #15893, test_large_zip's actual test is run in a child process, so when this test raises a MemoryError exception, the exception is lost and the @requires_memory decorator can't catch it to return an xfail. This commit uses a boolean variable in shared memory to flag if the exception was raised, and in that case, re-raise it in the parent process. Fixes #16889
* TST: Simplify assert_warns in test_io.pySeth Troisi2020-05-281-17/+8
|
* BUG: Fix default fallback in genfromtxtSebastian Berg2020-05-181-0/+7
| | | | | | | | | This affected (for example?) if the `dtype=object` was used without a converter, meaning that the default one is used. And this is currently the last one, which is `string_` (and thus bytes). Closes gh-16189
* TST: Add slow_pypy supportAnirudh Subramanian2020-04-131-0/+1
|
* TST: Run test_large_zip in a child process (#15893)Anirudh Subramanian2020-04-021-7/+12
| | | * Run test_large_zip in a child process
* BUG, TST: fix f2py for PyPy, skip one test for PyPy (#15750)Matti Picus2020-03-181-8/+9
| | | * BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
* DEP: Do not allow "abstract" dtype conversion/creationSebastian Berg2020-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | These dtypes do not really make sense as instances. We can (somewhat) reasonably define np.dtype(np.int64) as the default (machine endianess) int64. (Arguably, it is unclear that `np.array(arr_of_>f8, dtype="f")` should return arr_of_<f8, but that would be very noisy!) However, `np.integer` as equivalent to long, is not well defined. Similarly, `dtype=Decimal` may be neat to spell `dtype=object` when you intend to put Decimal objects into the array. But it is misleading, since there is no special meaning to it at this time. The biggest issue with it, is that `arr.astype(np.floating)` looks like it will let float32 or float128 pass, but it will force a float64 output! Arguably downcasting is a bug in this case. A related issue is `np.dtype("S")` and especially "S0". The dtype "S" does make sense for most or all places where `dtype=...` can be passed. However, it is conceptionally different from other dtypes, since it will not end up being attached to the array (unlike "S2" which would be). The dtype "S" really means the type number/DType class of String, and not a specific dtype instance.
* MAINT: Python2 CleanupsSeth Troisi2020-01-211-3/+2
|
* NEP: issue deprecation warning when creating ragged array (NEP 34)Matti Picus2020-01-211-1/+1
| | | | This implements NEP 34.
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-151-11/+4
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-8/+8
| | | | | | | 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.
* Revert "DEP: issue deprecation warning when creating ragged array (NEP 34)"revert-14794-nep-0034-implRalf Gommers2019-12-061-1/+1
|
* TST: fix up issues in requires_memory decoratorPauli Virtanen2019-12-041-1/+1
| | | | Fix wrong multiplier for /proc/meminfo, and do style cleanups.
* Merge pull request #14794 from mattip/nep-0034-implRalf Gommers2019-12-021-1/+1
|\ | | | | DEP: issue deprecation warning when creating ragged array (NEP 34)
| * TST: fix failing testmattip2019-10-311-1/+1
| |
* | TST: add pytest machinery to specify memory requirements for testsPauli Virtanen2019-12-011-5/+2
| |
* | MAINT: Remove uses of scalar aliasesEric Wieser2019-11-131-13/+13
|/ | | | Relates to gh-6103
* MAINT: Avoid all BytesWarningJon Dufresne2019-09-251-1/+1
| | | | | | | | A BytesWarning can be emitted when bytes are and strings are mismatched. Catching BytesWarning ensures a better boundary between str and bytes type. The test suite is now run with the -b flag to emit this warning. Fixes #9308
* Merge remote-tracking branch 'upstream/master' into fix-if-fieldsEric Wieser2019-08-191-63/+154
|\
| * fixes StopIteration error for empty file with skip_header > 0Maxwell Aladago2019-08-111-0/+4
| |
| * TST Test file-like object detection in save/loadLuis Pedro Coelho2019-07-201-0/+38
| |
| * Merge branch 'master' into force-zip64Charles Harris2019-06-261-57/+58
| |\
| | * Merge pull request #13222 from kritisingh1/patch1Matti Picus2019-06-101-57/+58
| | |\ | | | | | | | | DOC: Document/ Deprecate functions exposed in "numpy" namespace
| | | * Fix testskritisingh12019-04-101-61/+60
| | | |
| | | * Issue deprecation warningskritisingh12019-04-051-2/+4
| | | |
| * | | ENH: always use zip64, upgrade pickle protocol to 3mattip2019-05-231-3/+15
| |/ /
| * | Merge pull request #13409 from seberg/fix-unicode-fmt-savetxtMatti Picus2019-04-261-0/+13
| |\ \ | | | | | | | | BUG: (py2 only) fix unicode support for savetxt fmt string
| | * | BUG: (py2 only) fix unicode support for savetxt fmt stringSebastian Berg2019-04-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By now, all that is needed is to also allow unicode strings to pass through. Adds a test for the support which already succeeds on python3. Closes gh-4053 (replaces the old PR)
| * | | BUG: load fails when using pickle without allow_pickle=TruePaul Ivanov2019-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | a partial mitigation of #12759. see also https://nvd.nist.gov/vuln/detail/CVE-2019-6446
| * | | TST: unit test for gh-13200Tyler Reddy2019-04-131-1/+14
| |/ /
| * | TST: fix up test_structured_paddedTyler Reddy2019-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * minor reviewer adjustments in PR 13301: in test_structured_padded it is necessary to perform the seek after writing to the file, and to specify a fmt option to match the expected result
| * | BUG: Fix crash when calling savetxt on a padded arrayEric Wieser2019-04-111-1/+11
| |/ | | | | | | | | | | As a general rule, _every_ use of `.descr` is broken. Fixes #13297
* | BUG: Fix crash on genfromtxt with nested empty structured arrayEric Wieser2019-08-191-0/+7
|/ | | | Previously this would fail with `ValueError: could not assign tuple of length 2 to structure with 3 fields.`, now it raises `NotImplementedError`.
* MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) ↵Roman Yurchak2018-12-061-3/+1
| | | | | | | | | | | | (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments
* ENH: add back the multifield copy->view changeAllan Haldane2018-11-261-0/+10
| | | | | Fixes #10409 Closes #11530
* ENH: Improve support for pathlib.Path objects in load functions (#11348)Paul Müller2018-11-011-1/+25
| | | * ENH: Improve support for pathlib.Path objects in more functions
* Merge pull request #11962 from mfkasim91/limitrowloadtxtCharles Harris2018-09-301-0/+49
|\ | | | | ENH: maximum lines of content to be read from numpy.loadtxt
| * ENH: add max_rows kwarg to numpy.loadtxt like numpy.genfromtxtmfkasim912018-09-301-0/+49
| |
* | TST: prefer pytest.skip() over SkipTestTyler Reddy2018-09-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | * 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: refactor design of recursive closures (#11910)Matti Picus2018-09-161-0/+6
|/