NilsJPWerner / autoDocstring

VSCode extension that generates docstrings for python files
MIT License
676 stars 162 forks source link

parameter type cannot be recognized properly in Numpy style docstring #292

Open wohenbushuang opened 1 month ago

wohenbushuang commented 1 month ago

Describe the bug

In the following case, dict type of node_attr cannot be recognized.

By the way, can the parameter default value move up to be after the type description for more attention? Besides, change by default to default as Numpy Style Guide does

Versions (please complete the following information):

Original Code (with line to generate on):

class Test:
    def load_graph_file(
            self,
            filename: str,
            node_attr: dict = {"successor_idx": "successor_idx"},
            edge_attr: dict = {},
        ):
        pass
        # generate on this line

Expected Result:

        """_summary_

        Parameters
        ----------
        filename : str
            _description_
        node_attr : dict, optional, default {"successor_idx": "successor_idx"}
            _description_
        edge_attr : dict, optional, default {}
            _description_
        """

Actual Result:

        """_summary_

        Parameters
        ----------
        filename : str
            _description_
        node_attr : _type_, optional
            _description_, by default {"successor_idx": "successor_idx"}
        edge_attr : dict, optional
            _description_, by default {}
        """