Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand docscrape to support more numpy sections #534

Open
dsm-72 opened this issue Aug 17, 2023 · 2 comments
Open

Expand docscrape to support more numpy sections #534

dsm-72 opened this issue Aug 17, 2023 · 2 comments

Comments

@dsm-72
Copy link
Contributor

dsm-72 commented Aug 17, 2023

Please see numpy format

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)        
@jph00
Copy link
Contributor

jph00 commented Apr 26, 2024

Feel free to do a PR with any additions you need.

@dsm-72
Copy link
Contributor Author

dsm-72 commented Apr 26, 2024

@jph00 okie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants