| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
>>> field = unstructured_to_structured(np.zeros((20, 2)), dtype=[('x', float), ('y', float)]) # failed
>>> field = unstructured_to_structured(np.zeros((20, 2)), dtype=np.dtype([('x', float), ('y', float)])) # success
After:
>>> field = unstructured_to_structured(np.zeros((20, 2)), dtype=[('x', float), ('y', float)]) # success
>>> field = unstructured_to_structured(np.zeros((20, 2)), dtype=np.dtype([('x', float), ('y', float)])) # success
Closes gh-22428
|
|
|
|
|
|
| |
* if you believe the comments that this warning suppression
should be safe to remove after `1.16`, then it should
be safe to remove now?
|
|
|
| |
Co-authored-by: Matti Picus <matti.picus@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
```
In [1]: np.dtype({"names": ["a"], "formats": [int], "offsets": [2]})
Out[1]: dtype({'names':['a'], 'formats':['<i8'], 'offsets':[2], 'itemsize':10})
```
After:
```
In [1]: np.dtype({"names": ["a"], "formats": [int], "offsets": [2]})
Out[1]: dtype({'names': ['a'], 'formats': ['<i8'], 'offsets': [2], 'itemsize': 10})
```
* Allow switching back to old dtype printing format.
* Add changelog.
|
|
|
| |
* DOC: Fix typos in versionchanged.
|
| |
|
|
|
|
|
|
|
|
|
| |
This PR uses simple cases of PEP 380 to rewrite:
for v in g:
yield v
into:
yield from <expr>
|
|
|
|
|
|
|
| |
This replaces basestring with str except in
- tools/npy_tempita/
- numpy/compat/py3k.py
|
| |
|
| |
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|\
| |
| | |
BUG: Fix flatten_dtype so that nested 0-field structs are flattened correctly
|
| |
| |
| |
| | |
This affects the behavior of merge_arrays.
|
|/
|
|
| |
This return value was not documented and did not make any sense. There's no reason to have a special case here.
|
|\
| |
| | |
MAINT: Fix behavior of structured_to_unstructured on non-trivial dtypes
|
| |
| |
| |
| | |
Fixes #13333
|
|\ \
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
* DOC, MAINT: Misc. typo fixes
Found via `codespell`
|
| |\
| | |
| | | |
BUG: Always return views from structured_to_unstructured when possible
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Also applies to unstructured_to_structured
While producing correct resutls, the test added in this commit would previously make an unecessary copy, causing the assertion to fail.
The cause was `astype` was being asked to convert from a subarray of shape `(x, y)` to one of `(x*y,)`, which it cannot do without making a copy.
This changes the approach used to skip the step of flattening subarrays to 1d
|
| |\ \
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* added lib.recfunctions to refguide
PUBLIC_SUBMODULES, as the doctests
were otherwise not getting executed
* fixed a failing doctest in
recfunctions after above activation
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* ported the refguide_check module from SciPy for usage
in NumPy docstring execution/ verification; added the
refguide_check run to Azure Mac OS CI
* adjusted NumPy docstrings such that refguide_check passes
|
| |/
| |
| |
| |
| |
| | |
Previously a single-field type would decay, which is undesirable.
The included test previously did not pass
|
| |
| |
| |
| | |
It's not clear that these have any visible effect, but we should be consistent with how we detect structured types.
|
| |
| |
| |
| |
| | |
Also adjust the code to more clearly indicate what actually happens.
The behavior is identical before and after this patch.
|
|/
|
|
|
|
| |
Replacing empty tuples with `None` is a bad idea, and just results in an API that is hard to consume - especially since the behavior was never documented.
This affects `get_names`, `get_names_flat`, and `get_fieldstructure`.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Adds helper functions for the copy->view transition for multi-field
indexes. Adds `structured_to_unstructured`, `apply_along_fields`,
`assign_fields_by_name`, `require_fields`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ENH: __array_function__ support for np.lib, part 2
xref GH12028
np.lib.npyio through np.lib.ufunclike
* Fix failures in numpy/core/tests/test_overrides.py
* CLN: handle depreaction in dispatchers for np.lib.ufunclike
* CLN: fewer dispatchers in lib.twodim_base
* CLN: fewer dispatchers in lib.shape_base
* CLN: more dispatcher consolidation
* BUG: fix test failure
* Use all method instead of function in assert_equal
* DOC: indicate n is array_like in scimath.logn
* MAINT: updates per review
* MAINT: more conservative changes in assert_array_equal
* MAINT: add back in comment
* MAINT: casting tweaks in assert_array_equal
* MAINT: fixes and tests for assert_array_equal on subclasses
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This change shouldn't affect behaviour - all old uses were still correct.
|
|
|
|
| |
Again, fixed by not using descr
|
|
|
|
|
|
|
|
|
| |
It seems that working with .descr is a generally terrible idea.
Instead we introduce `get_fieldspec`, which returns a list of 2-tuples,
encapsulating subdtypes.
This also means that np.core.test_rational.rational survives a roundtrip - its
.descr is 'V8', which ddoesn't survive
|
|
|
|
| |
Fixes #9338
|
| |
|