0

我正在使用带有 numpydoc 扩展名的 sphinx。

当我制作 html 时,我的“示例”段落中的每个最后一项都被破坏了。

这就是我尝试制作的文件:

        """
        ...
        Examples
        --------
        Example of using gauss_elem with no option:

        >>> a = Matrix([[1,2,3],[2,5,3],[1,0,8]])
        >>> print(a.gauss_elem())
        [[-40 16  9]
         [ 13 -5 -3]
         [  5 -2 -1]]

        Example of using gauss_elem with option:

        >>> b = Matrix([[1,0,0],[0,1,0],[0,1,1]])
        >>> print(a.gauss_elem(b))
        [[-40 16  9]
         [ 13 -5 -3]
         [  5 -2 -1]]

        Example of using step by step solution:

        >>> a.gauss_elem(step_by_step=True)

        1 2 3 | 1 0 0
        2 5 3 | 0 1 0
        1 0 8 | 0 0 1
        Add row 1 * -2 to row 2
            ...

        """

但是输出是这样的。 在最后一个元素处输出格式损坏的图像链接

这有什么问题?

已编辑

正如史蒂夫皮尔西所说,我改变了我的代码,它现在适用于gauss_elem.

但是,还有两个问题。

这是另一个文档字符串:

        """
        ...
        Examples
        --------
        Example of using inv_using_det:

        >>> a = Matrix([[1,2,3],[2,5,3],[1,0,8]]
        >>> print(a.inv_using_det())
        [[-40 16  9]
         [ 13 -5 -3]
         [  5 -2 -1]]

        Example of using step by step solution:

        >>>a.inv_using_det(step_by_step=True)
        Get adjugate matrix before transpose
        [[ 40 -13 -5]
         [-16   5  2]
         [ -9   3  1]]
        Transpose it
            ...
        """

这是另一个格式损坏的输出。

4

1 回答 1

0

好的。我找到了我的问题的解决方案。

问题在这里:>>>a.get_inv_using_det

它必须是:>>> a.get_inv_using_det

它现在工作正常。

于 2019-06-03T11:18:23.743 回答