Skip to content

Commit

Permalink
Merge pull request #261 from aldanor/feature/npyffi-and-descr
Browse files Browse the repository at this point in the history
`PyArrayDescr` methods like in `np.dtype` + some missing stuff in `npyffi`
  • Loading branch information
adamreichold authored Jan 23, 2022
2 parents e029867 + a4a4016 commit 54b14e0
Show file tree
Hide file tree
Showing 7 changed files with 439 additions and 27 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
- `i32`, `i64`, `u32` and `u64` are now guaranteed to map to
`np.int32`, `np.int64`, `np.uint32` and `np.uint64` respectively
- Remove `cfg_if` dependency
- New methods in `PyArrayDescr`, catching up with `np.dtype`:
- `num`, `base`, `ndim`, `shape`, `byteorder`, `char`, `kind`, `itemsize`,
`alignment`, `flags`, `has_object`, `is_aligned_struct`, `names`
- Added `get_field` to query fields of structured dtypes
- Additional helper methods: `has_subarray`, `has_fields`, `is_native_byteorder`
- Renamed `get_type` to `typeobj`

- v0.15.1
- Make arrays produced via `IntoPyArray`, i.e. those owning Rust data, writeable ([#235](https://github.com/PyO3/rust-numpy/pull/235))
Expand Down
2 changes: 1 addition & 1 deletion src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ impl<T: Element + AsPrimitive<f64>> PyArray<T, Ix1> {
start.as_(),
stop.as_(),
step.as_(),
T::get_dtype(py).get_typenum(),
T::get_dtype(py).num(),
);
Self::from_owned_ptr(py, ptr)
}
Expand Down
Loading

0 comments on commit 54b14e0

Please sign in to comment.