| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|
|
| |
Address gh-14142 for the 1.18 release: warn when saving a dtype with metadata that cannot be loaded.
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
All of this code was already correct, this just tidies it a little
|
|/ |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
| |
This works towards adding a third format that supports utf8
|
|
|
|
|
|
| |
a partial mitigation of #12759.
see also https://nvd.nist.gov/vuln/detail/CVE-2019-6446
|
|
|
|
|
|
|
|
|
|
| |
`"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
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
| |
* ENH: Improve support for pathlib.Path objects in more functions
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
with empty dtypes. See #6430
|
|
|
|
|
| |
Prevents overflow errors for large arrays on systems
where the default int type is int32.
|
| |
|
| |
|
|
|
|
| |
Previously the passed in version was ignored
|
|
|
|
|
|
|
| |
Previously read_array_header_1_0 & read_array_header_2_0 were not
returning the documented results.
Closes #5602
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
As discussed on gh-5413. Version 2.0 was added in gh-4765.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This only happens when C long is smaller than npy_intp, in particular,
on 64 bit windows. The 'L' suffix is not needed as long as safe_eval
is used to recover the values, and the long intrinsic causes problems
for python3.
The python3 read side has been fixed, but we might as well fix the
problem at the root as well.
|
|
|
|
|
|
|
|
|
|
| |
The Python2 generated file had long integer literals like '1L' that
broke in Python3. The fix here is to filter out the 'L' and let
safe_eval take care of the integer type in converting the string.
The fix here comes from Nathaniel Smith with a few added fixups.
Closes #5170.
|
|
|
|
| |
The rules enforced are the same as those used for scipy.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new format only increases the header length field to 4 bytes.
allows storing structured arrays with a large number of named columns.
The dtype serialization for these can exceed the 2 byte header length
field required by the 1.0 format.
The generic functions automatically use the 2.0 format if the to be
stored data requires it. To avoid unintentional incompatibilies a
UserWarning is emitted when this happens.
If the format is not required the more compatible 1.0 format is used.
Closes gh-4690
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
This wrapper function is used everywhere in format.py now to ensure to
correctly the handle the case when fp.read returns fewer bytes than
requested.
Also added a test for the orignal bug, loading an array of size more
than 64K from a zip file.
|