Skip to content

Commit 54b14e0

Browse files
authored
Merge pull request #261 from aldanor/feature/npyffi-and-descr
`PyArrayDescr` methods like in `np.dtype` + some missing stuff in `npyffi`
2 parents e029867 + a4a4016 commit 54b14e0

File tree

7 files changed

+439
-27
lines changed

7 files changed

+439
-27
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
- `i32`, `i64`, `u32` and `u64` are now guaranteed to map to
1919
`np.int32`, `np.int64`, `np.uint32` and `np.uint64` respectively
2020
- Remove `cfg_if` dependency
21+
- New methods in `PyArrayDescr`, catching up with `np.dtype`:
22+
- `num`, `base`, `ndim`, `shape`, `byteorder`, `char`, `kind`, `itemsize`,
23+
`alignment`, `flags`, `has_object`, `is_aligned_struct`, `names`
24+
- Added `get_field` to query fields of structured dtypes
25+
- Additional helper methods: `has_subarray`, `has_fields`, `is_native_byteorder`
26+
- Renamed `get_type` to `typeobj`
2127

2228
- v0.15.1
2329
- Make arrays produced via `IntoPyArray`, i.e. those owning Rust data, writeable ([#235](https://github.com/PyO3/rust-numpy/pull/235))

src/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ impl<T: Element + AsPrimitive<f64>> PyArray<T, Ix1> {
12321232
start.as_(),
12331233
stop.as_(),
12341234
step.as_(),
1235-
T::get_dtype(py).get_typenum(),
1235+
T::get_dtype(py).num(),
12361236
);
12371237
Self::from_owned_ptr(py, ptr)
12381238
}

0 commit comments

Comments
 (0)