Skip to content

Commit ef74ac9

Browse files
andrei.papouandrei-papou
authored andcommitted
Updated deprecation version for stack function, suppressed deprecation warnings
1 parent 14f2f57 commit ef74ac9

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/impl_methods.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::iter::{
2828
IndexedIter, IndexedIterMut, Iter, IterMut, Lanes, LanesMut, Windows,
2929
};
3030
use crate::slice::MultiSlice;
31-
use crate::stacking::stack;
31+
use crate::stacking::concatenate;
3232
use crate::{NdIndex, Slice, SliceInfo, SliceOrIndex};
3333

3434
/// # Methods For All Array Types
@@ -840,7 +840,7 @@ where
840840
dim.set_axis(axis, 0);
841841
unsafe { Array::from_shape_vec_unchecked(dim, vec![]) }
842842
} else {
843-
stack(axis, &subs).unwrap()
843+
concatenate(axis, &subs).unwrap()
844844
}
845845
}
846846

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ use crate::iterators::{ElementsBase, ElementsBaseMut, Iter, IterMut, Lanes, Lane
131131

132132
pub use crate::arraytraits::AsArray;
133133
pub use crate::linalg_traits::{LinalgScalar, NdFloat};
134+
135+
#[allow(deprecated)]
134136
pub use crate::stacking::{concatenate, stack, stack_new_axis};
135137

136138
pub use crate::impl_views::IndexLonger;

src/stacking.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::imp_prelude::*;
3030
/// );
3131
/// ```
3232
#[deprecated(
33-
since = "0.13.0",
33+
since = "0.13.1",
3434
note = "Please use the `concatenate` function instead"
3535
)]
3636
pub fn stack<A, D>(axis: Axis, arrays: &[ArrayView<A, D>]) -> Result<Array<A, D>, ShapeError>
@@ -97,6 +97,7 @@ where
9797
/// [3., 3.]]))
9898
/// );
9999
/// ```
100+
#[allow(deprecated)]
100101
pub fn concatenate<A, D>(axis: Axis, arrays: &[ArrayView<A, D>]) -> Result<Array<A, D>, ShapeError>
101102
where
102103
A: Copy,

tests/stacking.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(deprecated)]
2+
13
use ndarray::{arr2, arr3, aview1, concatenate, stack, Array2, Axis, ErrorKind, Ix1};
24

35
#[test]

0 commit comments

Comments
 (0)