summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_io.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|/
* TST: Replace calls to unittest.TestCase.fail (#11933)Roman Yurchak2018-09-121-6/+2
| | | | | | | | 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
* TST: Fix duplicated test name.Elliott Sales de Andrade2018-09-061-2/+2
| | | | | It's a straightforward copy&paste error, but it means not all these tests get run.
* MAINT: reformat line spacing before test methodsmattip2018-08-191-2/+0
|
* MAINT, DOC: Fix typos (#10958)Nicholas Nadeau, P.Eng., AVS2018-04-231-1/+1
| | | | | | | | | | | | * fixed doc typo * fixed lib typos * fixed lapack_lite typos * Revert "fixed lapack_lite typos" This reverts commit e7dada860cb73af190234402508ab79965ecd079.
* Merge pull request #10891 from eric-wieser/assert-no-cyclesCharles Harris2018-04-211-11/+2
|\ | | | | TST: Extract a helper function to test for reference cycles
| * TST: Extract a helper function to test for reference cyclesEric Wieser2018-04-121-11/+2
| | | | | | | | | | | | This also means we can now test that our test is actually able to detect the type of failure we expect Trying to give myself some tools to debug the failure at https://github.com/numpy/numpy/pull/10882/files#r180813166
* | BUG: fix crash in numpy.genfromtxt(..., names=True, comments=None) (#10822)Raunak Shah2018-04-161-0/+7
| | | | | | | | Fixes gh-10780
* | BUG: fix savetxt, loadtxt for '+-' in complexmattip2018-04-101-0/+40
|/
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-061-6/+3
| | | | | 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-27/+23
| | | | | | | | | | | 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 use of unittest in NumPy tests.xoviat2018-03-211-2/+2
| | | | | | | | | | | | | | | | This removes a few left over uses of unittest. The main changes apart from removal of Test case are: * `setUp` replaced by nose and pytest compatible `setup` * `tearDown` replaced by nose and pytest compatible `teardown` * `assertRaises` replaced by `assert_raises` * `assertEqual` replaced by `assert_equal` The last two are in `numpy/testings/tests/test_utils.py`, so may seem a but circular, but at least are limited to those two functions. The use of `setup` and `teardown`, can be fixed up with the pytest equivalents after we have switched to pytest.
* Fix low-hanging Pypy compatibility issues (#10737)Pauli Virtanen2018-03-121-1/+2
| | | | | | | | | | | | | * TST: skip refcount-requiring tests if sys.refcount is missing * ENH: io: add refcheck=False to a safe .resize() call The array is allocated immediately above, and the resize always succeeds so it is not necessary to check it. Fixes Pypy compatibility. * TST: remove unused code * TST: factor skipif(not HAS_REFCOUNT) into a separate decorator
* Merge pull request #10501 from msornay/fromregex-bytesEric Wieser2018-02-201-1/+8
|\ | | | | BUG: fromregex: asbytes called on regexp objects
| * BUG: fromregex: asbytes called on regexp objectsMathieu Sornay2018-02-051-1/+8
| | | | | | | | | | | | When calling fromregex() with a binary stream and a regular expression object, asbytes() was called on the regexp object, resulting in an incorrect regular expression being compiled and used.
* | Merge pull request #10401 from eric-wieser/fix-10394Charles Harris2018-02-061-0/+7
|\ \ | |/ |/| BUG: Resize bytes_ columns in genfromtxt
| * BUG: Resize bytes_ columns in genfromtxtEric Wieser2018-01-151-0/+7
| | | | | | | | Fixes gh-10394, due to regression in gh-10054
* | More misc. typosluz.paz2018-01-041-4/+4
|/ | | Found via `codespell`
* MAINT: Various minor code cleanups.Charles Harris2017-11-241-56/+59
| | | | Minor cleanups of old code to reflect more modern usage.
* ENH: Add encoding option to numpy text IO.Julian Taylor2017-11-211-31/+361
| | | | | | | | | | | This modifies loadtxt and genfromtxt in several ways intended to add unicode support for text files by adding an `encoding` keyword to np.load, np.genfromtxt, np.savetxt, and np.fromregex. The original treatment of the relevant files was to open them as byte files, whereas they are now opened as text files with an encoding. When read, they are decoded to unicode strings for Python3 compatibility, and when written, they are encoded as specified. For backward compatibility, the default encoding in both cases is latin1.
* ENH Better error message for savetxt when X.ndim > 2Nelle Varoquaux2017-09-201-0/+6
| | | | | savetxt does not support saving arrays of dimension 0 or higher than 2. This pull request improves the message of the error raised.
* TST: Fix/Remove old unit tests for structure assignmentAllan Haldane2017-09-071-2/+2
|
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-051-20/+20
| | | | | | | This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
* TST: Remove unittest dependencies in numpy/lib/tests.Charles Harris2017-07-241-16/+16
|
* Merge pull request #6632 from mcmtroffaes/feature/fromfile-ioopen-bugCharles Harris2017-04-141-2/+3
|\ | | | | TST/BUG: fromfile - fix test and expose bug with io class argument
| * BUG: npy_PyFile_Dup2 - fix PyFile_AsFile failing on io style classesMatthias C. M. Troffaes2016-09-081-2/+3
| | | | | | | | | | | | | | | | | | | | This bug only manifests itself in the Python 2 code path. Falls back to the current Python 3 code path also on Python 2 because the Python 3 code path is written precisely to handle this situation. Also fix tests, and clarify in the documentation that the current implementation requires the stream to be seekable.
* | MAINT: Replace unicode() with u prefixEric Wieser2017-03-251-1/+1
| |
* | MAINT: Other cleanup Python < 2.7 and Python3 < 3.4Alexandr Shadchin2016-12-091-6/+4
| |
* | BUG: Apply more robust string converts in loadtxtgfyoung2016-12-081-0/+9
|/ | | | | | | | | | The original dtype converters for bytes and str did not account for converting objects of str or bytes dtype respectively. Replace the original converters with those from numpy.compat, which are much more robust. Closes gh-8033.