diff options
author | Matthias Bussonnier <bussonniermatthias@gmail.com> | 2022-01-30 20:49:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-30 11:49:47 -0800 |
commit | bc6a6084f6e49bd78c12508131395304a63cc6ca (patch) | |
tree | 4e8ccc3daa31f410bf3e31471425d3f2754eae56 /numpy/core/shape_base.py | |
parent | c900978d5e572d96ccacaa97af28e2c5f4a0b137 (diff) | |
download | numpy-bc6a6084f6e49bd78c12508131395304a63cc6ca.tar.gz |
DOC: improper doc syntax (markdown and imbalanced ticks). (#20944)
Here are two modifications:
The first one is the inclusion of markdown fence blocks in the middle of
RST. While this is not really a problem for current documentation as
this is a private function, it still makes other RST parser choke on
this.
In particular this is seen as a tile as it is a text line followed by
a line of only backticks, and that makes my new project to show better
docstrings in Jupyter fails.
I can locally exclude this function, but while not fix it to show good
examples ?
Second, while grepping for triple backticks I found that there are a
stray one in another place.
Diffstat (limited to 'numpy/core/shape_base.py')
-rw-r--r-- | numpy/core/shape_base.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py index a81a04f7f..1a4198c5f 100644 --- a/numpy/core/shape_base.py +++ b/numpy/core/shape_base.py @@ -543,25 +543,23 @@ def _concatenate_shapes(shapes, axis): Returns ------- shape: tuple of int - This tuple satisfies: - ``` - shape, _ = _concatenate_shapes([arr.shape for shape in arrs], axis) - shape == concatenate(arrs, axis).shape - ``` + This tuple satisfies:: + + shape, _ = _concatenate_shapes([arr.shape for shape in arrs], axis) + shape == concatenate(arrs, axis).shape slice_prefixes: tuple of (slice(start, end), ) For a list of arrays being concatenated, this returns the slice in the larger array at axis that needs to be sliced into. - For example, the following holds: - ``` - ret = concatenate([a, b, c], axis) - _, (sl_a, sl_b, sl_c) = concatenate_slices([a, b, c], axis) + For example, the following holds:: + + ret = concatenate([a, b, c], axis) + _, (sl_a, sl_b, sl_c) = concatenate_slices([a, b, c], axis) - ret[(slice(None),) * axis + sl_a] == a - ret[(slice(None),) * axis + sl_b] == b - ret[(slice(None),) * axis + sl_c] == c - ``` + ret[(slice(None),) * axis + sl_a] == a + ret[(slice(None),) * axis + sl_b] == b + ret[(slice(None),) * axis + sl_c] == c These are called slice prefixes since they are used in the recursive blocking algorithm to compute the left-most slices during the |