AnswerDotAI / AnswerDotAI/fastcore

Expand docscrape to support more numpy sections

Open
#534 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
1.1k
Forks
295
Avg merge
1d 6h
Merged PRs (30d)
7

Description

Please see [numpy format](https://numpydoc.readthedocs.io/en/latest/format.html#see-also)

```
class NumpyDocString(Mapping):
"""Parses a numpydoc string to an abstract representation """
sections = { 'Summary': [''], 'Extended': [], 'Parameters': [], 'Returns': [] }

def __init__(self, docstring, config=None):
docstring = textwrap.dedent(docstring).split('\n')
self._doc = Reader(docstring)
self._parsed_data = copy.deepcopy(self.sections)
self._parse()
self['Parameters'] = {o.name:o for o in self['Parameters']}
if self['Returns']: self['Returns'] = self['Returns'][0]
self['Summary'] = dedent_lines(self['Summary'], split=False)
self['Extended'] = dedent_lines(self['Extended'], split=False)
```

Contributor guide

Open the contributing guide

Research direction

The issue points to the numpydoc format reference and the NumpyDocString entry point; start by comparing the parser's supported sections with that reference. Done means the additional sections are represented in the abstract result while preserving the existing Summary, Extended, Parameters, and Returns handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.