{"action":"created","issue":{"url":"https://api.github.com/repos/labrad/pylabrad/issues/195","labels_url":"https://api.github.com/repos/labrad/pylabrad/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/labrad/pylabrad/issues/195/comments","events_url":"https://api.github.com/repos/labrad/pylabrad/issues/195/events","html_url":"https://github.com/labrad/pylabrad/issues/195","id":116218211,"number":195,"title":"docstring example(s) on the wiki","user":{"login":"jayich","id":5204577,"avatar_url":"https://avatars.githubusercontent.com/u/5204577?v=3","gravatar_id":"","url":"https://api.github.com/users/jayich","html_url":"https://github.com/jayich","followers_url":"https://api.github.com/users/jayich/followers","following_url":"https://api.github.com/users/jayich/following{/other_user}","gists_url":"https://api.github.com/users/jayich/gists{/gist_id}","starred_url":"https://api.github.com/users/jayich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayich/subscriptions","organizations_url":"https://api.github.com/users/jayich/orgs","repos_url":"https://api.github.com/users/jayich/repos","events_url":"https://api.github.com/users/jayich/events{/privacy}","received_events_url":"https://api.github.com/users/jayich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-10T22:36:30Z","updated_at":"2015-11-18T21:15:28Z","closed_at":null,"body":"Including example docstrings in the Writing Servers (https://github.com/labrad/pylabrad/wiki/Writing-Servers) on the wiki would be helpful.  I would put an example in this issue, but I keep getting my server docstrings mixed up...\r\n\r\n\r\nlabel: doc/wiki"},"comment":{"url":"https://api.github.com/repos/labrad/pylabrad/issues/comments/157865539","html_url":"https://github.com/labrad/pylabrad/issues/195#issuecomment-157865539","issue_url":"https://api.github.com/repos/labrad/pylabrad/issues/195","id":157865539,"user":{"login":"jayich","id":5204577,"avatar_url":"https://avatars.githubusercontent.com/u/5204577?v=3","gravatar_id":"","url":"https://api.github.com/users/jayich","html_url":"https://github.com/jayich","followers_url":"https://api.github.com/users/jayich/followers","following_url":"https://api.github.com/users/jayich/following{/other_user}","gists_url":"https://api.github.com/users/jayich/gists{/gist_id}","starred_url":"https://api.github.com/users/jayich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayich/subscriptions","organizations_url":"https://api.github.com/users/jayich/orgs","repos_url":"https://api.github.com/users/jayich/repos","events_url":"https://api.github.com/users/jayich/events{/privacy}","received_events_url":"https://api.github.com/users/jayich/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T21:15:28Z","updated_at":"2015-11-18T21:15:28Z","body":"I think I am just missing something about how to write docstrings for servers.  Here is an example:\r\n\r\n```python\r\n    @setting(21, channel=['i'], meas_type=['s'], returns=['?'])\r\n    def measure(self, c, channel=1, meas_type='VPP'):\r\n        \"\"\"\r\n        Make a particular voltage measurement of a channel, e.g. Vpp or Vmax\r\n        For the valid meas_type strs, i.e. what you can measure, see the\r\n        agilent programmers guide.\r\n\r\n        Parameters\r\n        ----------\r\n        channel: int, channel to measure, default(1)\r\n        meas_type: str, VISA str specifying measurement type, default('VPP')\r\n        meas_type options:\r\n            VAVerage - the average voltage over the display\r\n            VPP - peak to peak voltage\r\n            VRMS - RMS voltage over the display\r\n\r\n        Returns\r\n        -------\r\n        WithUnit Volts\r\n        \"\"\"\r\n        dev = self.selectedDevice(c)\r\n        val = yield dev.measureQuery(channel, meas_type)\r\n        voltage = WithUnit(val, 'V')\r\n        returnValue(voltage)\r\n```\r\n\r\nThen when I go to an ipython shell:\r\n\r\n```python\r\n>>> ag = cxn.agilent_dso1024a\r\n>>> ag.measure?\r\n```\r\n\r\nthe shell gives me the following text:\r\n```\r\nType:           SettingWrapper\r\nString form:\r\nLabRAD Setting: \"Agilent DSO1024A\" >> \"measure\" (ID=21)\r\n           \r\n           Make a particular voltage measurement of <...> annel}: defaults [meas_type='VPP']\r\n           : defaults [channel=1, meas_type='VPP']\r\n           \r\n           Returns:\r\n           ?\r\nFile:           c:\\anaconda\\lib\\site-packages\\labrad\\client.py\r\nSignature:      ag.measure(self, *args, **kw)\r\nDocstring:\r\nObject to wrap a single setting on a single server.\r\n\r\nInformation about the setting is loaded on demand and cached.\r\nYou can force a refresh of this information by calling the refresh()\r\nmethod.  Calling this object directly will send a request.\r\nCall signature: ag.measure(*args, **kw)\r\n```\r\n\r\nYou can see that there are a few problems with the information that is printed in the shell.  I think I am confused about the server docstring parsing and an example docstring that gets parsed correctly outputtting all the docstring information (or at least not as garbled as what I get now) would be helpful.  Possibly I need to change some default ipython shell setting to verbose?  I would really like access to more information in the docstring in the python shell.  I'll read through the writing servers section on the wiki again.\r\n\r\n\r\n\r\n"}}