我正在使用带有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
...
"""但是输出是这样的。Output image link with broken format at last element
这有什么问题?
编辑过的
正如Steve Piercy所说,我更改了我的代码,现在它可以在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
...
"""发布于 2019-06-03 19:18:24
好的。我找到了我的问题的答案。
问题出在这里:>>>a.get_inv_using_det
它必须是:>>> a.get_inv_using_det
它现在运行得很好。
https://stackoverflow.com/questions/56413176
复制相似问题