greenape/mktheapidocs

Parsing parameters with array shapes

Opened this issue · 0 comments

moble commented

First, thanks very much for this excellent extension. It's so nice to get away from sphinx.

But I am having one little problem. I don't think it's explicitly mentioned in the numpydoc standard, but one common form for parameter types includes adding some shape parameters, as in

a : (..., M, M) array_like

In fact, this form is explicitly described in numpy's documentation, and used — just to pick the first example that came to mind — in docstrings like cholesky's.

Unfortunately, this syntax doesn't seem to parse correctly with this package. It looks like it's splitting on , and then reversing the list. I don't claim to understand your code, but this observation appears consistent with what's happening here. I know regexes matching parentheses are hard, so maybe rather than just finding commas, it could walk through the string, turning off splitting while there are unmatched parentheses?