@@ -219,6 +219,47 @@ impl RawSelection {
219
219
}
220
220
}
221
221
222
+ /// A selector of a one-dimensional array
223
+ ///
224
+ /// The following examples will use an array of 11 elements
225
+ /// to illustrate the various selections. The active elements
226
+ /// are marked with an `s`.
227
+ /// ```text
228
+ /// // An array of 11 elements
229
+ /// x x x x x x x x x x x
230
+ /// ```
231
+ ///
232
+ /// ```text
233
+ /// Index(4)
234
+ /// _ _ _ _ s _ _ _ _ _ _
235
+ /// ```
236
+ /// ```text
237
+ /// Slice { start: 0, step: 3, end: 4, block: 1 }
238
+ /// s _ _ s _ _ _ _ _ _ _
239
+ /// ```
240
+ /// ```text
241
+ /// SliceTo { start: 2, step: 3, end: 8, block: 1 }
242
+ /// _ _ s _ _ s _ _ _ _ _
243
+ /// ```
244
+ /// ```text
245
+ /// SliceCount { start: 1, step: 3, count: 2, block: 1 }
246
+ /// _ s _ _ s _ _ s _ _ _
247
+ /// ```
248
+ /// ```text
249
+ /// Unlimited { start: 0, step: 3, block: 1 }
250
+ /// s _ _ s _ _ s _ _ s _
251
+ /// ```
252
+ /// ```text
253
+ /// Unlimited { start: 2, step: 3, block: 1 }
254
+ /// _ _ s _ _ s _ _ s _ _
255
+ /// ```
256
+ /// ```text
257
+ /// Unlimited { start: 0, step: 4, block: 2 }
258
+ /// s s _ _ s s _ _ s s _
259
+ /// ```
260
+ ///
261
+ /// See also [`this hdf5 tutorial`](https://support.hdfgroup.org/HDF5/Tutor/select.html)
262
+ /// for more information on hyperslab selections.
222
263
#[ derive( Clone , Copy , Debug , Eq ) ]
223
264
pub enum SliceOrIndex {
224
265
/// A single index
@@ -533,6 +574,11 @@ impl Display for SliceOrIndex {
533
574
}
534
575
535
576
#[ derive( Clone , Debug , PartialEq , Eq ) ]
577
+ /// A descriptor of a selection of an N-dimensional array.
578
+ ///
579
+ /// The Hyperslab consists of [`slices`](SliceOrIndex) in N dimensions,
580
+ /// spanning an N-dimensional hypercube. This type is used as a [`selector`](Selection)
581
+ /// for retrieving and putting data to a [`Container`](Container).
536
582
pub struct Hyperslab {
537
583
dims : Vec < SliceOrIndex > ,
538
584
}
@@ -723,6 +769,7 @@ impl Display for Hyperslab {
723
769
}
724
770
725
771
#[ derive( Clone , Debug , PartialEq , Eq ) ]
772
+ /// A selection used for reading and writing to a [`Container`](Container).
726
773
pub enum Selection {
727
774
All ,
728
775
Points ( Array2 < Ix > ) ,
0 commit comments