pyment icon indicating copy to clipboard operation
pyment copied to clipboard

Google docs to reST difficulties with arg type + description

Open tristanlatr opened this issue 5 years ago • 3 comments

Hello,

I'm trying to convert automatically google docstrings to reST but not all infos seem to be parsed.

The description do not show up in the patch when the argument type is specified in the parenthesis. Only the type and the default value actually appears.

Any help would be appreciated!

Thanks :)

The following code

def qry_load_data(self, retry=1, wait_timeout_sec=120):
    """
    Internal

    Helper method to execute the query and load the data:
        - Submit the query
        - Wait the query to be executed
        - Get and parse the events

    Arguments:
        retry (int): number of time the query can be failed and retried
        wait_timeout_sec (int): wait timeout in seconds

    Returns: 
        tuple: (`msiempy.event.EventManager`, Query completed? `bool`)

    Raises:
        msiempy.core.session.NitroError if any unhandled errors.
        TimeoutError if wait_timeout_sec counter gets to 0.
    """
    pass

Generate the following patch

# Patch generated by Pyment v0.3.3

--- a/test.py
+++ b/test.py
@@ -1,21 +1,16 @@
 def qry_load_data(self, retry=1, wait_timeout_sec=120):
-    """
-    Internal
-
+    """Internal
+    
     Helper method to execute the query and load the data:
         - Submit the query
         - Wait the query to be executed
         - Get and parse the events
 
-    Arguments:
-        retry (int): number of time the query can be failed and retried
-        wait_timeout_sec (int): wait timeout in seconds
+    :param retry: int (Default value = 1)
+    :param wait_timeout_sec: int (Default value = 120)
+    :returns: tuple: (`msiempy.event.EventManager`, Query completed? `bool`)
+    :raises msiempy.core.session.NitroError: if any unhandled errors
+    :raises TimeoutError: if wait_timeout_sec counter gets to 0
 
-    Returns: 
-        tuple: (`msiempy.event.EventManager`, Query completed? `bool`)
-
-    Raises:
-        msiempy.core.session.NitroError if any unhandled errors.
-        TimeoutError if wait_timeout_sec counter gets to 0.
     """
     pass

tristanlatr avatar Oct 09 '20 18:10 tristanlatr

+1 for related issue. The other way around doesn't generate docstrings with parentheses, which doesn't match google's style guide it seems.

Trezorro avatar Feb 20 '21 14:02 Trezorro

Hi! thanks for reporting, I'll get a look.

dadadel avatar Feb 20 '21 17:02 dadadel

This issue seems related to issue #48

dadadel avatar Feb 20 '21 20:02 dadadel