Skip to content

Commit

Permalink
Merge pull request #1515 from JohanMabille/range_doc
Browse files Browse the repository at this point in the history
Improved range documentation
  • Loading branch information
JohanMabille committed Apr 11, 2019
2 parents 9587800 + 76f6c80 commit 7a31e4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/source/view.rst
Expand Up @@ -23,8 +23,8 @@ instantiated directly, but though the ``view`` helper function.
Slices can be specified in the following ways:

- selection in a dimension by specifying an index (unsigned integer)
- ``range(min, max)``, a slice representing an interval
- ``range(min, max, step)``, a slice representing a stepped interval
- ``range(min, max)``, a slice representing the interval [min, max)
- ``range(min, max, step)``, a slice representing the stepped interval [min, max)
- ``all()``, a slice representing all the elements of a dimension
- ``newaxis()``, a slice representing an additional dimension of length one
- ``keep(i0, i1, i2, ...)`` a slice selecting non-contiguous indices to keep on the underlying expression
Expand Down
6 changes: 3 additions & 3 deletions include/xtensor/xslice.hpp
Expand Up @@ -779,14 +779,14 @@ namespace xt
}

/**
* Select a range from start_val to stop_val.
* Select a range from start_val to stop_val (excluded).
* You can use the shorthand `_` syntax to select from the start or until the end.
*
* \code{.cpp}
* using namespace xt::placeholders; // to enable _ syntax
*
* range(3, _) // select from index 3 to the end
* range(_, 5) // select from index o to 5
* range(_, 5) // select from index 0 to 5 (excluded)
* range(_, _) // equivalent to `all()`
* \endcode
*
Expand All @@ -800,7 +800,7 @@ namespace xt
}

/**
* Select a range from start_val to stop_val with step
* Select a range from start_val to stop_val (excluded) with step
* You can use the shorthand `_` syntax to select from the start or until the end.
*
* \code{.cpp}
Expand Down

0 comments on commit 7a31e4b

Please sign in to comment.