Skip to content

Wrong number of Parameter for numpy array. #285

Closed
@Carreau

Description

@Carreau
In [1]: from numpydoc.docscrape import NumpyDocString
   ...: from numpy import array
   ...: len(NumpyDocString(array.__doc__)['Parameters'])
Out[1]: 1

(should be 6)

Again due to a dedent issue:

$ git diff
diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py
index d79992c..3db20fe 100644
--- a/numpydoc/docscrape.py
+++ b/numpydoc/docscrape.py
@@ -219,6 +219,7 @@ class NumpyDocString(Mapping):
                 yield name, self._strip(data[2:])

     def _parse_param_list(self, content, single_element_is_type=False):
+        content = dedent_lines(content)
         r = Reader(content)
         params = []
         while not r.eof():

Fixes it.

Not quite sure why it is not found in tests...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions