summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Fix reference roles of `ast`yuki2023-03-251-7/+7
|
* ENH: Faster numpy.load (try/except _filter_header) (#22916)Michael2023-01-131-4/+18
| | | | | | | 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>
* Merge pull request #22393 from seberg/npy_headerMatti Picus2022-10-071-9/+50
|\ | | | | MAINT: Ensure graceful handling of large header sizes
| * MAINT: Ensure graceful handling of large header sizesSebastian Berg2022-10-061-9/+50
| | | | | | | | | | | | | | | | | | 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-0/+11
|/
* Addressing review for more cleanup and clarificationBrigitta Sipőcz2022-05-171-2/+1
|
* Remove python <3.6 related thingsBrigitta Sipocz2022-05-171-1/+1
|
* Add space after argument nameOscar Gustafsson2022-04-031-4/+4
|
* DOC: Typos found by codespellDimitri Papadopoulos2021-09-211-1/+1
|
* MAINT: revise OSError aliases (IOError, EnvironmentError)Mike Taves2021-09-021-3/+2
|
* MAINT: Remove unused imports and unreachable code (#18762)Elisha Hollander2021-07-071-1/+1
| | | * Remove unnecessary imports and minor fixes
* DOC: typo fixGuo2021-07-031-1/+1
|
* ENH: Improve performance of `np.save` for small arrays (gh-18657)Ohad Ravid2021-03-241-6/+10
| | | | | | | | | | | | | | | | | * ENH: Remove call to `_filter_header` from `_write_array_header` Improve performance of `np.save` by removing the call when writing the header, as it is known to be done in Python 3. * ENH: Only call `_filter_header` from `_read_array_header` for old vers Improve performance of `np.load` for arrays with version >= (3,0) by removing the call, as it is known to be done in Python 3. * ENH: Use a set of keys when checking `read_array` Improve performance of `np.load`. * DOC: Improve performance of `np.{save,load}` for small arrays
* MAINT: Added Chain exceptions where appropriate (#18400)Abhay Raghuvanshi2021-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | * Added chain exception in _pocketfft.py * Added chain exception in format.py * Added chain exception in make_lite.py * Added chain exception in mrecords.py * added from e for exceptions * Minor update for _read_array_header exception msg * Removed \n from excp msg and e from msg format. Co-authored-by: Eric Wieser <wieser.eric@gmail.com> * Update numpy/linalg/lapack_lite/make_lite.py Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
* MAINT: Added Chain exceptions where appropriate (#18394)Abhay Raghuvanshi2021-03-181-4/+4
| | | | | | | | | | | | | | | | | | | | | * Added chain exception in _bits_of func * Added chain exception * Added chain exception in unixccompiler.py * Added chain exception in config.py * Added chain exception in fcompiler __init__.py * Added chain exception in compaq.py * Added chain exception in format.py * Updated raise chain exception * STY: Break long line. Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
* fix exception chaining in format.pyAbhishek Singh2020-10-041-1/+1
|
* DOC: Fix non-matching pronoun in format.py documentation. (gh-17022)Phoenix Meadowlark2020-08-061-1/+1
| | | Follow up to [this commit](https://github.com/numpy/numpy/commit/36f71788620bb17d123669cf03f086fb2b87b3a8), which missed the second pronoun in this sentence.
* DOC: fixed docstring for descr_to_dtypeiamsoto2020-06-251-8/+20
| | | | DOC: fixed docstring for descr_to_dtype
* Fix broken link in open_memmap See AlsoRoss Barnowski2020-06-241-1/+1
|
* DOC: Use intersphinx for NEP referencesBen Nathanson2020-06-041-2/+2
| | | | | | | | | | | | | Per #16500 discussion, adds link updates to PR. Replaces NEP URLs with intersphinx links in these files: * doc/HOWTO_RELEASE.rst.txt * doc/source/dev/howto-docs.rst * numpy/doc/dispatch.py * numpy/lib/format.py and incorporates @rossbar's #16502 change of `config.py`.
* MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-261-2/+2
| | | | | types (#15816) Cleanup from the dropping of python 2
* BUG: np.load does not handle empty array with an empty descr (#15397)Sha Liu2020-01-271-7/+10
| | | | | | | 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: Clean up, mostly unused imports.Warren Weckesser2020-01-231-1/+1
|
* [MAINT] Cleanup python2 sys.version checksSeth Troisi2020-01-201-19/+7
|
* MAINT: cleanup sys.version dependant codeSeth Troisi2020-01-121-5/+2
|
* 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/+14
| | | Address gh-14142 for the 1.18 release: warn when saving a dtype with metadata that cannot be loaded.
* TST: make xfailed test for modules in public API pass.Ralf Gommers2019-09-191-0/+3
|
* DOC: add space between words across linesmattip2019-07-101-1/+1
|
* Merge branch 'master' into force-zip64Charles Harris2019-06-261-8/+2
|\
| * MAINT: Use a with statement instead of try / finallyEric Wieser2019-06-041-8/+2
| | | | | | | | All of this code was already correct, this just tidies it a little
* | ENH: always use zip64, upgrade pickle protocol to 3mattip2019-05-231-3/+2
|/
* Merge branch 'master' into npy-2.1Matti Picus2019-05-191-4/+8
|\
| * MAINT: remove uneeded codemattip2019-05-111-6/+4
| |
| * BUG: parse more subarrays in descr_to_dtypemattip2019-05-031-2/+7
| |
| * BUG: handle subarrays in descr_to_dtypemattip2019-04-301-3/+4
| |
* | BUG/ENH: Create npy format 3.0Eric Wieser2019-05-071-15/+36
| | | | | | | | | | | | | | | | 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
* | MAINT: Simplify computation of npy format headersEric Wieser2019-05-071-49/+52
|/ | | | This works towards adding a third format that supports utf8
* BUG: load fails when using pickle without allow_pickle=TruePaul Ivanov2019-04-161-3/+7
| | | | | | a partial mitigation of #12759. see also https://nvd.nist.gov/vuln/detail/CVE-2019-6446
* BUG: Fix errors in string formatting while producing an errorEric Wieser2019-03-021-13/+13
| | | | | | | | | | `"Invalid version %r" % (1, 2)` would fail with `TypeError: not all arguments converted during string formatting` The `Header is not a dictionary` error had a similar problem. Fixed by changing this entire function to use `.format` in place of `%`, which does not have this gotcha. Found using LGTM.com
* MAINT: Move pickle import to numpy.compatCharles Harris2019-02-211-2/+1
| | | | | | | The pickle module was being imported from numpy.core.numeric. It was defined there in order to use pickle5 when available in Python3 and cpickle in Python2. The numpy.compat module seems a better place for that.
* MAINT: fix from reviewmattip2018-11-141-6/+2
|
* BUG: fix for titles, cleanup, fixes from reviewmattip2018-11-131-7/+20
|
* BUG: test, fix loading structured dtypes with paddingmattip2018-11-131-1/+29
|
* ENH: Improve support for pathlib.Path objects in load functions (#11348)Paul Müller2018-11-011-7/+9
| | | * ENH: Improve support for pathlib.Path objects in more functions
* MAINT, TST import pickle from numpy.core.numericPierre Glaser2018-10-101-4/+1
| | | | | | | | All imports of pickle from numpy modules are now done this way: >>> from numpy.core.numeric import pickle Also, some loops on protocol numbers are added over pickle tests that were not caught from #12090
* HTTP -> HTTPS, and other linkrot fixesMike Toews2018-06-161-1/+1
|
* DOC: add numpy.lib.format to docs and link to itmattip2018-05-141-4/+3
|
* DOC: create label and ref, fixes broken linkmattip2018-05-131-0/+3
|
* DOC: link to updated module docstring, not NEPmattip2018-05-131-3/+8
|