Skip to content

Commit c9c07f2

Browse files
committed
Rename .isubview() -> .subview_inplace()
1 parent 7118fb4 commit c9c07f2

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/impl_methods.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
429429
/// and select the subview of `index` along that axis.
430430
///
431431
/// **Panics** if `index` is past the length of the axis.
432-
pub fn isubview(&mut self, axis: Axis, index: Ix) {
432+
pub fn subview_inplace(&mut self, axis: Axis, index: Ix) {
433433
dimension::do_sub(&mut self.dim, &mut self.ptr, &self.strides,
434434
axis.index(), index)
435435
}
@@ -441,7 +441,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
441441
pub fn into_subview(mut self, axis: Axis, index: Ix) -> ArrayBase<S, D::Smaller>
442442
where D: RemoveAxis,
443443
{
444-
self.isubview(axis, index);
444+
self.subview_inplace(axis, index);
445445
self.remove_axis(axis)
446446
}
447447

@@ -472,7 +472,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
472472
{
473473
let mut subs = vec![self.view(); indices.len()];
474474
for (&i, sub) in zip(indices, &mut subs[..]) {
475-
sub.isubview(axis, i);
475+
sub.subview_inplace(axis, i);
476476
}
477477
if subs.is_empty() {
478478
let mut dim = self.raw_dim();

src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,17 @@ pub type Ixs = isize;
476476
///
477477
/// ## Subviews
478478
///
479-
/// Subview methods allow you to restrict the array view while removing
480-
/// one axis from the array. Subview methods include `.subview()`,
481-
/// `.isubview()`, `.subview_mut()`.
479+
/// Subview methods allow you to restrict the array view while removing one
480+
/// axis from the array. Subview methods include [`.subview()`],
481+
/// [`.subview_mut()`], [`.into_subview()`], and [`.subview_inplace()`].
482482
///
483483
/// Subview takes two arguments: `axis` and `index`.
484484
///
485+
/// [`.subview()`]: #method.subview
486+
/// [`.subview_mut()`]: #method.subview_mut
487+
/// [`.into_subview()`]: #method.into_subview
488+
/// [`.subview_inplace()`]: #method.subview_inplace
489+
///
485490
/// ```
486491
/// use ndarray::{arr3, aview2, Axis};
487492
///
@@ -515,8 +520,8 @@ pub type Ixs = isize;
515520
/// [ 7, 10]]));
516521
/// ```
517522
///
518-
/// `.isubview()` modifies the view in the same way as `subview()`, but
519-
/// since it is *in place*, it cannot remove the collapsed axis. It becomes
523+
/// [`.subview_inplace()`] modifies the view in the same way as [`.subview()`],
524+
/// but since it is *in place*, it cannot remove the collapsed axis. It becomes
520525
/// an axis of length 1.
521526
///
522527
/// `.outer_iter()` is an iterator of every subview along the zeroth (outer)

0 commit comments

Comments
 (0)