@@ -16,7 +16,7 @@ use std::ops::{Deref, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, Rang
16
16
17
17
/// A slice (range with step size).
18
18
///
19
- /// `end` is an exclusive index. Negative `begin ` or `end` indexes are counted
19
+ /// `end` is an exclusive index. Negative `start ` or `end` indexes are counted
20
20
/// from the back of the axis. If `end` is `None`, the slice extends to the end
21
21
/// of the axis.
22
22
///
@@ -36,8 +36,12 @@ use std::ops::{Deref, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, Rang
36
36
/// The Python equivalent is `[a::-1]`.
37
37
#[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash ) ]
38
38
pub struct Slice {
39
+ /// start index; negative are counted from the back of the axis
39
40
pub start : isize ,
41
+ /// end index; negative are counted from the back of the axis; when not present
42
+ /// the default is the full length of the axis.
40
43
pub end : Option < isize > ,
44
+ /// step size in elements; the default is 1, for every element.
41
45
pub step : isize ,
42
46
}
43
47
@@ -105,12 +109,16 @@ pub struct NewAxis;
105
109
/// `[np.newaxis]`. The macro equivalent is `s![NewAxis]`.
106
110
#[ derive( Debug , PartialEq , Eq , Hash ) ]
107
111
pub enum SliceInfoElem {
108
- /// A range with step size. `end` is an exclusive index. Negative `begin `
112
+ /// A range with step size. `end` is an exclusive index. Negative `start `
109
113
/// or `end` indexes are counted from the back of the axis. If `end` is
110
114
/// `None`, the slice extends to the end of the axis.
111
115
Slice {
116
+ /// start index; negative are counted from the back of the axis
112
117
start : isize ,
118
+ /// end index; negative are counted from the back of the axis; when not present
119
+ /// the default is the full length of the axis.
113
120
end : Option < isize > ,
121
+ /// step size in elements; the default is 1, for every element.
114
122
step : isize ,
115
123
} ,
116
124
/// A single index.
0 commit comments