-
Couldn't load subscription status.
- Fork 512
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hi! I'm trying to port an existing codebase to nbdev and running into trouble with docstrings.
I'm not sure if I'm not following numpy style docstrings as strictly as I should and tripping over the parser in the process, or whether this is a legitimate bug, so here's a minimal example
I've included a method documented with docments which of course renders nicely.
#| export
class Test:
"""A class for testing
Second line.
Parameters
----------
x
First param
y
Second param in which I have added a /
line break due to length
Attributes
----------
comb
String combination of `x` and `y`
"""
def __init__(self, x: str, y: Optional[int] = None):
self.x = x
self.y = y
self.comb = x + str(y)
def print(self,
end: str = "-", # Line ending
) -> None: # No need to return anything, just print
"""Print attrs
Print attrs 2
"""
print(self.x, self.y, end=end)
- A warning is printed in the rendered docs due to the
Attributessection (/Users/rafxavier/Envs/poniard/lib/python3.8/site-packages/fastcore/docscrape.py:225: UserWarning: Unknown section Attributes else: warn(msg)). This is probably because fastcore/docscrape does not support it. Is this intentional? What about other standard numpy sections likeRaises? The idea is to document these in notebook markdown? - Types are correctly pulled from the signature and descriptions from the docstings, and everything is rendered nicely in a table. However, a
Parameterssection with weird formatting is also included.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

