From 73b6b1c2bddf9a1bc91e0eb08e665aaddfc50fe7 Mon Sep 17 00:00:00 2001 From: Jim Turner Date: Wed, 17 Mar 2021 20:06:26 -0400 Subject: [PATCH] DOC: Add more info about slicing changes to RELEASES.md --- RELEASES.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index afbc6a19c..b2c13fdd3 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4,7 +4,11 @@ Version 0.15.0 (Not released yet) New features ------------ -- Support inserting new axes while slicing by [@jturner314] +- Support inserting new axes while slicing by [@jturner314]. This is an example: + + ```rust + let view = arr.slice(s![.., -1, 2..;-1, NewAxis]); + ``` https://github.com/rust-ndarray/ndarray/pull/570 @@ -72,6 +76,30 @@ Enhancements API changes ----------- +- Changes to the slicing-related types and macro by [@jturner314] and [@bluss]: + + - Remove the `Dimension::SliceArg` associated type, and add a new `SliceArg` + trait for this purpose. + - Change the return type of the `s![]` macro to an owned `SliceInfo` rather + than a reference. + - Replace the `SliceOrIndex` enum with `SliceInfoElem`, which has an + additional `NewAxis` variant and does not have a `step_by` method. + - Change the type parameters of `SliceInfo` in order to support the `NewAxis` + functionality and remove some tricky `unsafe` code. + - Mark the `SliceInfo::new` method as `unsafe`. The new implementations of + `TryFrom` can be used as a safe alternative. + - Remove the `AsRef> for SliceInfo` + implementation. Add the similar `From<&'a SliceInfo> for + SliceInfo<&'a [SliceInfoElem], Din, Dout>` conversion as an alternative. + - Change the *expr* `;` *step* case in the `s![]` macro to error at compile + time if an unsupported type for *expr* is used, instead of panicking at + runtime. + + https://github.com/rust-ndarray/ndarray/pull/570
+ https://github.com/rust-ndarray/ndarray/pull/940
+ https://github.com/rust-ndarray/ndarray/pull/943
+ https://github.com/rust-ndarray/ndarray/pull/945
+ - Removed already deprecated methods by [@bluss]: - Remove deprecated `.all_close()` - use approx feature and methods like `.abs_diff_eq` instead @@ -142,6 +170,12 @@ Bug fixes https://github.com/rust-ndarray/ndarray/pull/855 +- Mark the `SliceInfo::new` method as `unsafe` due to the requirement that + `indices.as_ref()` always return the same value when called multiple times, + by [@bluss] and [@jturner314] + + https://github.com/rust-ndarray/ndarray/pull/570 + Other changes -------------