{"action":"created","issue":{"url":"https://api.github.com/repos/ooreilly/mydocstring/issues/5","repository_url":"https://api.github.com/repos/ooreilly/mydocstring","labels_url":"https://api.github.com/repos/ooreilly/mydocstring/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/ooreilly/mydocstring/issues/5/comments","events_url":"https://api.github.com/repos/ooreilly/mydocstring/issues/5/events","html_url":"https://github.com/ooreilly/mydocstring/pull/5","id":390774142,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4NDY1MjIy","number":5,"title":"Add pybind tests for classes and overloaded functions","user":{"login":"gcarleo","id":28149892,"node_id":"MDQ6VXNlcjI4MTQ5ODky","avatar_url":"https://avatars0.githubusercontent.com/u/28149892?v=4","gravatar_id":"","url":"https://api.github.com/users/gcarleo","html_url":"https://github.com/gcarleo","followers_url":"https://api.github.com/users/gcarleo/followers","following_url":"https://api.github.com/users/gcarleo/following{/other_user}","gists_url":"https://api.github.com/users/gcarleo/gists{/gist_id}","starred_url":"https://api.github.com/users/gcarleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcarleo/subscriptions","organizations_url":"https://api.github.com/users/gcarleo/orgs","repos_url":"https://api.github.com/users/gcarleo/repos","events_url":"https://api.github.com/users/gcarleo/events{/privacy}","received_events_url":"https://api.github.com/users/gcarleo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-12-13T17:06:37Z","updated_at":"2018-12-22T06:19:22Z","closed_at":"2018-12-13T20:18:57Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ooreilly/mydocstring/pulls/5","html_url":"https://github.com/ooreilly/mydocstring/pull/5","diff_url":"https://github.com/ooreilly/mydocstring/pull/5.diff","patch_url":"https://github.com/ooreilly/mydocstring/pull/5.patch"},"body":"I added a couple of examples docstrings resulting from pybind bindings conversions. \r\n\r\nThe most straightforward one is an example class. I didn't manage to get the class to be parsed correctly though, maybe there is still some glitch to be fixed here? \r\n\r\nThe second example is about overloaded methods, and it's a bit more involved. I proposed in the test a possible way of extracting the two overloaded functions as an array in the json. Let me know if you prefer other solutions! Thanks "},"comment":{"url":"https://api.github.com/repos/ooreilly/mydocstring/issues/comments/449548833","html_url":"https://github.com/ooreilly/mydocstring/pull/5#issuecomment-449548833","issue_url":"https://api.github.com/repos/ooreilly/mydocstring/issues/5","id":449548833,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTU0ODgzMw==","user":{"login":"ooreilly","id":13162518,"node_id":"MDQ6VXNlcjEzMTYyNTE4","avatar_url":"https://avatars0.githubusercontent.com/u/13162518?v=4","gravatar_id":"","url":"https://api.github.com/users/ooreilly","html_url":"https://github.com/ooreilly","followers_url":"https://api.github.com/users/ooreilly/followers","following_url":"https://api.github.com/users/ooreilly/following{/other_user}","gists_url":"https://api.github.com/users/ooreilly/gists{/gist_id}","starred_url":"https://api.github.com/users/ooreilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooreilly/subscriptions","organizations_url":"https://api.github.com/users/ooreilly/orgs","repos_url":"https://api.github.com/users/ooreilly/repos","events_url":"https://api.github.com/users/ooreilly/events{/privacy}","received_events_url":"https://api.github.com/users/ooreilly/received_events","type":"User","site_admin":false},"created_at":"2018-12-22T06:19:22Z","updated_at":"2018-12-22T06:19:22Z","author_association":"OWNER","body":"1. You make a good point. Since pybind generates information about the type, you do not need to provide it in the docstring. Currently, if you leave it out it in your docstring the Google docstring parser will still work, but leave out the type. I did write a method for extracting the types from the pybind-generated function header. The method `PyBindExtract.parse_signature(..)` will give you the args, including types. However, this information is not passed on to the parser. Maybe I can solve this by lett you pass the signature to the Parser. Something like `GoogleDocString(docstring, config={'signature' : signature})`. I can then also issue a warning if some args do not have any documentation, or their names do not match the provided input. Let you know your thoughts.\r\n\r\n2. I take it you do not like doing it manually like this?\r\n```python\r\n ...\r\n Examples:\r\n        Examples should be written in doctest format, and should illustrate how\r\n        to use the function.\r\n\r\n       ```python\r\n        >>> from python_example import operation\r\n        >>> print([i for i in example_generator(4)])\r\n        [0, 1, 2, 3]\r\n\r\n       ```\r\n\r\n    \"\"\"\r\n```\r\nThe above will render nicely in markdown, and it should not break your docstring tests. I tested a similar example using pytest -v --doctest-modules. You just need to make sure that you add an empty line after the output. \r\n\r\nIf you don't like the manual decoration, I can probably try to detect the presence of code in the docstring and automatically add the enclosing quotes. Importing the correct module will be trickier since that cannot be detected from the source code itself. Maybe we can fix that by allowing the user to pass it upon initialization as keyvalue arg as before.\r\n"}}
{"actor":{"display_login":"ooreilly"}}