@@ -13,40 +13,6 @@ use crate::dimension;
13
13
use crate :: error:: { from_kind, ErrorKind , ShapeError } ;
14
14
use crate :: imp_prelude:: * ;
15
15
16
- /// Stack arrays along the new axis.
17
- ///
18
- /// ***Errors*** if the arrays have mismatching shapes.
19
- /// ***Errors*** if `arrays` is empty, if `axis` is out of bounds,
20
- /// if the result is larger than is possible to represent.
21
- ///
22
- /// ```
23
- /// extern crate ndarray;
24
- ///
25
- /// use ndarray::{arr2, arr3, stack, Axis};
26
- ///
27
- /// # fn main() {
28
- ///
29
- /// let a = arr2(&[[2., 2.],
30
- /// [3., 3.]]);
31
- /// assert!(
32
- /// stack(Axis(0), &[a.view(), a.view()])
33
- /// == Ok(arr3(&[[[2., 2.],
34
- /// [3., 3.]],
35
- /// [[2., 2.],
36
- /// [3., 3.]]]))
37
- /// );
38
- /// # }
39
- /// ```
40
- pub fn stack < A , D > ( axis : Axis , arrays : & [ ArrayView < A , D > ] ) -> Result < Array < A , D :: Larger > , ShapeError >
41
- where
42
- A : Clone ,
43
- D : Dimension ,
44
- D :: Larger : RemoveAxis ,
45
- {
46
- #[ allow( deprecated) ]
47
- stack_new_axis ( axis, arrays)
48
- }
49
-
50
16
/// Concatenate arrays along the given axis.
51
17
///
52
18
/// ***Errors*** if the arrays have mismatching shapes, apart from along `axis`.
106
72
Ok ( res)
107
73
}
108
74
109
- #[ deprecated( note = "Use under the name stack instead." , since = "0.15.0" ) ]
110
75
/// Stack arrays along the new axis.
111
76
///
112
77
/// ***Errors*** if the arrays have mismatching shapes.
@@ -116,22 +81,22 @@ where
116
81
/// ```
117
82
/// extern crate ndarray;
118
83
///
119
- /// use ndarray::{arr2, arr3, stack_new_axis , Axis};
84
+ /// use ndarray::{arr2, arr3, stack , Axis};
120
85
///
121
86
/// # fn main() {
122
87
///
123
88
/// let a = arr2(&[[2., 2.],
124
89
/// [3., 3.]]);
125
90
/// assert!(
126
- /// stack_new_axis (Axis(0), &[a.view(), a.view()])
91
+ /// stack (Axis(0), &[a.view(), a.view()])
127
92
/// == Ok(arr3(&[[[2., 2.],
128
93
/// [3., 3.]],
129
94
/// [[2., 2.],
130
95
/// [3., 3.]]]))
131
96
/// );
132
97
/// # }
133
98
/// ```
134
- pub fn stack_new_axis < A , D > ( axis : Axis , arrays : & [ ArrayView < A , D > ] ) -> Result < Array < A , D :: Larger > , ShapeError >
99
+ pub fn stack < A , D > ( axis : Axis , arrays : & [ ArrayView < A , D > ] ) -> Result < Array < A , D :: Larger > , ShapeError >
135
100
where
136
101
A : Clone ,
137
102
D : Dimension ,
@@ -259,36 +224,3 @@ macro_rules! concatenate {
259
224
$crate:: concatenate( $axis, & [ $( $crate:: ArrayView :: from( & $array) ) ,* ] ) . unwrap( )
260
225
} ;
261
226
}
262
-
263
- /// Stack arrays along the new axis.
264
- ///
265
- /// Uses the [`stack_new_axis()`] function, calling `ArrayView::from(&a)` on each
266
- /// argument `a`.
267
- ///
268
- /// ***Panics*** if the `stack` function would return an error.
269
- ///
270
- /// ```
271
- /// extern crate ndarray;
272
- ///
273
- /// use ndarray::{arr2, arr3, stack_new_axis, Axis};
274
- ///
275
- /// # fn main() {
276
- ///
277
- /// let a = arr2(&[[2., 2.],
278
- /// [3., 3.]]);
279
- /// assert!(
280
- /// stack_new_axis![Axis(0), a, a]
281
- /// == arr3(&[[[2., 2.],
282
- /// [3., 3.]],
283
- /// [[2., 2.],
284
- /// [3., 3.]]])
285
- /// );
286
- /// # }
287
- /// ```
288
- #[ macro_export]
289
- #[ deprecated( note = "Use under the name stack instead." , since = "0.15.0" ) ]
290
- macro_rules! stack_new_axis {
291
- ( $axis: expr, $( $array: expr ) ,+ ) => {
292
- $crate:: stack_new_axis( $axis, & [ $( $crate:: ArrayView :: from( & $array) ) ,* ] ) . unwrap( )
293
- } ;
294
- }
0 commit comments