Skip to content

Commit

Permalink
Fixes doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
akern40 committed Oct 20, 2024
1 parent db52eab commit 2b34bf8
Show file tree
Hide file tree
Showing 17 changed files with 142 additions and 139 deletions.
2 changes: 1 addition & 1 deletion src/alias_asref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
///
/// - if an index is out of bounds
/// - if a step size is zero
/// - if [`SliceInfoElem::NewAxis`] is in `info`, e.g. if [`NewAxis`] was
/// - if [`NewAxis`](`crate::SliceInfoElem::NewAxis`) is in `info`, e.g. if `NewAxis` was
/// used in the [`s!`] macro
/// - if `D` is `IxDyn` and `info` does not match the number of array axes
#[track_caller]
Expand Down
97 changes: 50 additions & 47 deletions src/doc/ndarray_for_numpy_users/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
//!
//! </td><td>
//!
//! [`mat1.dot(&mat2)`][matrix-* dot]
//! [`mat1.dot(&mat2)`][dot-2-2]
//!
//! </td><td>
//!
Expand All @@ -336,7 +336,7 @@
//!
//! </td><td>
//!
//! [`mat.dot(&vec)`][matrix-* dot]
//! [`mat.dot(&vec)`][dot-2-1]
//!
//! </td><td>
//!
Expand All @@ -350,7 +350,7 @@
//!
//! </td><td>
//!
//! [`vec.dot(&mat)`][vec-* dot]
//! [`vec.dot(&mat)`][dot-1-2]
//!
//! </td><td>
//!
Expand All @@ -364,7 +364,7 @@
//!
//! </td><td>
//!
//! [`vec1.dot(&vec2)`][vec-* dot]
//! [`vec1.dot(&vec2)`][dot-1-1]
//!
//! </td><td>
//!
Expand Down Expand Up @@ -670,22 +670,22 @@
//! `a[:,4]` | [`a.column(4)`][.column()] or [`a.column_mut(4)`][.column_mut()] | view (or mutable view) of column 4 in a 2-D array
//! `a.shape[0] == a.shape[1]` | [`a.is_square()`][.is_square()] | check if the array is square
//!
//! [.abs_diff_eq()]: ArrayBase#impl-AbsDiffEq<ArrayBase<S2%2C%20D>>
//! [.assign()]: ArrayBase::assign
//! [.axis_iter()]: ArrayBase::axis_iter
//! [.ncols()]: ArrayBase::ncols
//! [.column()]: ArrayBase::column
//! [.column_mut()]: ArrayBase::column_mut
//! [.abs_diff_eq()]: ArrayRef#impl-AbsDiffEq%3CArrayRef%3CB,+D%3E%3E
//! [.assign()]: ArrayRef::assign
//! [.axis_iter()]: ArrayRef::axis_iter
//! [.ncols()]: LayoutRef::ncols
//! [.column()]: ArrayRef::column
//! [.column_mut()]: ArrayRef::column_mut
//! [concatenate()]: crate::concatenate()
//! [concatenate!]: crate::concatenate!
//! [stack!]: crate::stack!
//! [::default()]: ArrayBase::default
//! [.diag()]: ArrayBase::diag
//! [.dim()]: ArrayBase::dim
//! [.diag()]: ArrayRef::diag
//! [.dim()]: LayoutRef::dim
//! [::eye()]: ArrayBase::eye
//! [.fill()]: ArrayBase::fill
//! [.fold()]: ArrayBase::fold
//! [.fold_axis()]: ArrayBase::fold_axis
//! [.fill()]: ArrayRef::fill
//! [.fold()]: ArrayRef::fold
//! [.fold_axis()]: ArrayRef::fold_axis
//! [::from_elem()]: ArrayBase::from_elem
//! [::from_iter()]: ArrayBase::from_iter
//! [::from_diag()]: ArrayBase::from_diag
Expand All @@ -694,48 +694,51 @@
//! [::from_shape_vec_unchecked()]: ArrayBase::from_shape_vec_unchecked
//! [::from_vec()]: ArrayBase::from_vec
//! [.index()]: ArrayBase#impl-Index<I>
//! [.indexed_iter()]: ArrayBase::indexed_iter
//! [.indexed_iter()]: ArrayRef::indexed_iter
//! [.insert_axis()]: ArrayBase::insert_axis
//! [.is_empty()]: ArrayBase::is_empty
//! [.is_square()]: ArrayBase::is_square
//! [.iter()]: ArrayBase::iter
//! [.len()]: ArrayBase::len
//! [.len_of()]: ArrayBase::len_of
//! [.is_empty()]: LayoutRef::is_empty
//! [.is_square()]: LayoutRef::is_square
//! [.iter()]: ArrayRef::iter
//! [.len()]: LayoutRef::len
//! [.len_of()]: LayoutRef::len_of
//! [::linspace()]: ArrayBase::linspace
//! [::logspace()]: ArrayBase::logspace
//! [::geomspace()]: ArrayBase::geomspace
//! [.map()]: ArrayBase::map
//! [.map_axis()]: ArrayBase::map_axis
//! [.map_inplace()]: ArrayBase::map_inplace
//! [.mapv()]: ArrayBase::mapv
//! [.mapv_inplace()]: ArrayBase::mapv_inplace
//! [.map()]: ArrayRef::map
//! [.map_axis()]: ArrayRef::map_axis
//! [.map_inplace()]: ArrayRef::map_inplace
//! [.mapv()]: ArrayRef::mapv
//! [.mapv_inplace()]: ArrayRef::mapv_inplace
//! [.mapv_into()]: ArrayBase::mapv_into
//! [matrix-* dot]: ArrayBase::dot-1
//! [.mean()]: ArrayBase::mean
//! [.mean_axis()]: ArrayBase::mean_axis
//! [.ndim()]: ArrayBase::ndim
//! [dot-2-2]: ArrayRef#impl-Dot<ArrayRef<A,+Dim<[usize;+2]>>>-for-ArrayRef<A,+Dim<[usize;+2]>>
//! [dot-1-1]: ArrayRef#impl-Dot<ArrayRef<A,+Dim<[usize;+1]>>>-for-ArrayRef<A,+Dim<[usize;+1]>>
//! [dot-1-2]: ArrayRef#impl-Dot<ArrayRef<A,+Dim<[usize;+2]>>>-for-ArrayRef<A,+Dim<[usize;+1]>>
//! [dot-2-1]: ArrayRef#impl-Dot<ArrayRef<A,+Dim<[usize;+1]>>>-for-ArrayRef<A,+Dim<[usize;+2]>>
//! [.mean()]: ArrayRef::mean
//! [.mean_axis()]: ArrayRef::mean_axis
//! [.ndim()]: LayoutRef::ndim
//! [::ones()]: ArrayBase::ones
//! [.outer_iter()]: ArrayBase::outer_iter
//! [.outer_iter()]: ArrayRef::outer_iter
//! [::range()]: ArrayBase::range
//! [.raw_dim()]: ArrayBase::raw_dim
//! [.raw_dim()]: LayoutRef::raw_dim
//! [.reversed_axes()]: ArrayBase::reversed_axes
//! [.row()]: ArrayBase::row
//! [.row_mut()]: ArrayBase::row_mut
//! [.nrows()]: ArrayBase::nrows
//! [.sum()]: ArrayBase::sum
//! [.slice()]: ArrayBase::slice
//! [.slice_axis()]: ArrayBase::slice_axis
//! [.slice_collapse()]: ArrayBase::slice_collapse
//! [.row()]: ArrayRef::row
//! [.row_mut()]: ArrayRef::row_mut
//! [.nrows()]: LayoutRef::nrows
//! [.sum()]: ArrayRef::sum
//! [.slice()]: ArrayRef::slice
//! [.slice_axis()]: ArrayRef::slice_axis
//! [.slice_collapse()]: LayoutRef::slice_collapse
//! [.slice_move()]: ArrayBase::slice_move
//! [.slice_mut()]: ArrayBase::slice_mut
//! [.shape()]: ArrayBase::shape
//! [.slice_mut()]: ArrayRef::slice_mut
//! [.shape()]: LayoutRef::shape
//! [stack()]: crate::stack()
//! [.strides()]: ArrayBase::strides
//! [.index_axis()]: ArrayBase::index_axis
//! [.sum_axis()]: ArrayBase::sum_axis
//! [.t()]: ArrayBase::t
//! [vec-* dot]: ArrayBase::dot
//! [.for_each()]: ArrayBase::for_each
//! [.strides()]: LayoutRef::strides
//! [.index_axis()]: ArrayRef::index_axis
//! [.sum_axis()]: ArrayRef::sum_axis
//! [.t()]: ArrayRef::t
//! [vec-* dot]: ArrayRef::dot
//! [.for_each()]: ArrayRef::for_each
//! [::zeros()]: ArrayBase::zeros
//! [`Zip`]: crate::Zip
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ndarray_for_numpy_users/rk_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
//!
//! * Use [`c.mul_add(h, t)`](f64::mul_add) instead of `t + c * h`. This is
//! faster and reduces the floating-point error. It might also be beneficial
//! to use [`.scaled_add()`] or a combination of
//! to use [`.scaled_add()`](crate::ArrayRef::scaled_add) or a combination of
//! [`azip!()`] and [`.mul_add()`](f64::mul_add) on the arrays in
//! some places, but that's not demonstrated in the example below.
//!
Expand Down
16 changes: 8 additions & 8 deletions src/impl_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ where
/// If the input array is contiguous, then the output array will have the same
/// memory layout. Otherwise, the layout of the output array is unspecified.
/// If you need a particular layout, you can allocate a new array with the
/// desired memory layout and [`.assign()`](Self::assign) the data.
/// desired memory layout and [`.assign()`](ArrayRef::assign) the data.
/// Alternatively, you can collectan iterator, like this for a result in
/// standard layout:
///
Expand Down Expand Up @@ -630,9 +630,9 @@ impl<A, D: Dimension> LayoutRef<A, D>
/// collapsed, as in [`.collapse_axis()`], rather than removed, as in
/// [`.slice_move()`] or [`.index_axis_move()`].
///
/// [`.collapse_axis()`]: Self::collapse_axis
/// [`.slice_move()`]: Self::slice_move
/// [`.index_axis_move()`]: Self::index_axis_move
/// [`.collapse_axis()`]: LayoutRef::collapse_axis
/// [`.slice_move()`]: ArrayBase::slice_move
/// [`.index_axis_move()`]: ArrayBase::index_axis_move
///
/// See [*Slicing*](#slicing) for full documentation.
/// See also [`s!`], [`SliceArg`], and [`SliceInfo`](crate::SliceInfo).
Expand Down Expand Up @@ -1056,7 +1056,7 @@ where
{
/// Collapses the array to `index` along the axis and removes the axis.
///
/// See [`.index_axis()`](Self::index_axis) and [*Subviews*](#subviews) for full documentation.
/// See [`.index_axis()`](ArrayRef::index_axis) and [*Subviews*](#subviews) for full documentation.
///
/// **Panics** if `axis` or `index` is out of bounds.
#[track_caller]
Expand Down Expand Up @@ -1468,13 +1468,13 @@ impl<A, D: Dimension> ArrayRef<A, D>
/// `window_size`.
///
/// Note that passing a stride of only ones is similar to
/// calling [`ArrayBase::windows()`].
/// calling [`ArrayRef::windows()`].
///
/// **Panics** if any dimension of `window_size` or `stride` is zero.<br>
/// (**Panics** if `D` is `IxDyn` and `window_size` or `stride` does not match the
/// number of array axes.)
///
/// This is the same illustration found in [`ArrayBase::windows()`],
/// This is the same illustration found in [`ArrayRef::windows()`],
/// 2×2 windows in a 3×4 array, but now with a (1, 2) stride:
///
/// ```text
Expand Down Expand Up @@ -2943,7 +2943,7 @@ where
/// Elements are visited in arbitrary order.
///
/// [`mapv_into`]: ArrayBase::mapv_into
/// [`mapv`]: ArrayBase::mapv
/// [`mapv`]: ArrayRef::mapv
pub fn mapv_into_any<B, F>(self, mut f: F) -> Array<B, D>
where
S: DataMut,
Expand Down
4 changes: 2 additions & 2 deletions src/impl_views/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ where D: Dimension
/// Return the array’s data as a slice, if it is contiguous and in standard order.
/// Return `None` otherwise.
///
/// Note that while the method is similar to [`ArrayBase::as_slice()`], this method transfers
/// Note that while the method is similar to [`ArrayRef::as_slice()`], this method transfers
/// the view's lifetime to the slice, so it is a bit more powerful.
pub fn to_slice(&self) -> Option<&'a [A]>
{
Expand All @@ -50,7 +50,7 @@ where D: Dimension
/// Return `None` otherwise.
///
/// Note that while the method is similar to
/// [`ArrayBase::as_slice_memory_order()`], this method transfers the view's
/// [`ArrayRef::as_slice_memory_order()`], this method transfers the view's
/// lifetime to the slice, so it is a bit more powerful.
pub fn to_slice_memory_order(&self) -> Option<&'a [A]>
{
Expand Down
20 changes: 10 additions & 10 deletions src/impl_views/indexing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ pub trait IndexLonger<I>
/// See also [the `get` method][1] which works for all arrays and array
/// views.
///
/// [1]: ArrayBase::get
/// [1]: ArrayRef::get
///
/// **Panics** if index is out of bounds.
#[track_caller]
fn index(self, index: I) -> Self::Output;

/// Get a reference of a element through the view.
///
/// This method is like `ArrayBase::get` but with a longer lifetime (matching
/// This method is like `ArrayRef::get` but with a longer lifetime (matching
/// the array view); which we can only do for the array view and not in the
/// `Index` trait.
///
/// See also [the `get` method][1] (and [`get_mut`][2]) which works for all arrays and array
/// views.
///
/// [1]: ArrayBase::get
/// [2]: ArrayBase::get_mut
/// [1]: ArrayRef::get
/// [2]: ArrayRef::get_mut
///
/// **Panics** if index is out of bounds.
#[track_caller]
Expand All @@ -90,7 +90,7 @@ pub trait IndexLonger<I>
/// See also [the `uget` method][1] which works for all arrays and array
/// views.
///
/// [1]: ArrayBase::uget
/// [1]: ArrayRef::uget
///
/// **Note:** only unchecked for non-debug builds of ndarray.
///
Expand All @@ -116,7 +116,7 @@ where
/// See also [the `get` method][1] which works for all arrays and array
/// views.
///
/// [1]: ArrayBase::get
/// [1]: ArrayRef::get
///
/// **Panics** if index is out of bounds.
#[track_caller]
Expand All @@ -139,7 +139,7 @@ where
/// See also [the `uget` method][1] which works for all arrays and array
/// views.
///
/// [1]: ArrayBase::uget
/// [1]: ArrayRef::uget
///
/// **Note:** only unchecked for non-debug builds of ndarray.
unsafe fn uget(self, index: I) -> &'a A
Expand All @@ -165,7 +165,7 @@ where
/// See also [the `get_mut` method][1] which works for all arrays and array
/// views.
///
/// [1]: ArrayBase::get_mut
/// [1]: ArrayRef::get_mut
///
/// **Panics** if index is out of bounds.
#[track_caller]
Expand All @@ -186,7 +186,7 @@ where
/// See also [the `get_mut` method][1] which works for all arrays and array
/// views.
///
/// [1]: ArrayBase::get_mut
/// [1]: ArrayRef::get_mut
///
fn get(mut self, index: I) -> Option<&'a mut A>
{
Expand All @@ -205,7 +205,7 @@ where
/// See also [the `uget_mut` method][1] which works for all arrays and array
/// views.
///
/// [1]: ArrayBase::uget_mut
/// [1]: ArrayRef::uget_mut
///
/// **Note:** only unchecked for non-debug builds of ndarray.
unsafe fn uget(mut self, index: I) -> &'a mut A
Expand Down
2 changes: 1 addition & 1 deletion src/impl_views/splitting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ where D: Dimension
/// [`MultiSliceArg`], [`s!`], [`SliceArg`](crate::SliceArg), and
/// [`SliceInfo`](crate::SliceInfo).
///
/// [`.multi_slice_mut()`]: ArrayBase::multi_slice_mut
/// [`.multi_slice_mut()`]: ArrayRef::multi_slice_mut
///
/// **Panics** if any of the following occur:
///
Expand Down
8 changes: 4 additions & 4 deletions src/iterators/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl_ndproducer! {

/// Exact chunks producer and iterable.
///
/// See [`.exact_chunks()`](ArrayBase::exact_chunks) for more
/// See [`.exact_chunks()`](crate::ArrayRef::exact_chunks) for more
/// information.
//#[derive(Debug)]
pub struct ExactChunks<'a, A, D>
Expand Down Expand Up @@ -93,7 +93,7 @@ where

/// Exact chunks iterator.
///
/// See [`.exact_chunks()`](ArrayBase::exact_chunks) for more
/// See [`.exact_chunks()`](crate::ArrayRef::exact_chunks) for more
/// information.
pub struct ExactChunksIter<'a, A, D>
{
Expand Down Expand Up @@ -126,7 +126,7 @@ impl_ndproducer! {

/// Exact chunks producer and iterable.
///
/// See [`.exact_chunks_mut()`](ArrayBase::exact_chunks_mut)
/// See [`.exact_chunks_mut()`](crate::ArrayRef::exact_chunks_mut)
/// for more information.
//#[derive(Debug)]
pub struct ExactChunksMut<'a, A, D>
Expand Down Expand Up @@ -237,7 +237,7 @@ impl_iterator! {

/// Exact chunks iterator.
///
/// See [`.exact_chunks_mut()`](ArrayBase::exact_chunks_mut)
/// See [`.exact_chunks_mut()`](crate::ArrayRef::exact_chunks_mut)
/// for more information.
pub struct ExactChunksIterMut<'a, A, D>
{
Expand Down
4 changes: 2 additions & 2 deletions src/iterators/lanes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl_ndproducer! {
}
}

/// See [`.lanes()`](ArrayBase::lanes)
/// See [`.lanes()`](crate::ArrayRef::lanes)
/// for more information.
pub struct Lanes<'a, A, D>
{
Expand Down Expand Up @@ -92,7 +92,7 @@ where D: Dimension
}
}

/// See [`.lanes_mut()`](ArrayBase::lanes_mut)
/// See [`.lanes_mut()`](crate::ArrayRef::lanes_mut)
/// for more information.
pub struct LanesMut<'a, A, D>
{
Expand Down
Loading

0 comments on commit 2b34bf8

Please sign in to comment.