From bc6a6084f6e49bd78c12508131395304a63cc6ca Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Sun, 30 Jan 2022 20:49:47 +0100 Subject: 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. --- numpy/core/shape_base.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'numpy/core/shape_base.py') 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 -- cgit v1.2.1