{"action":"created","comment":{"url":"https://api.github.com/repos/NSLS-II/ophyd/pulls/comments/40141411","id":40141411,"diff_hunk":"@@ -325,3 +326,13 @@ def records_from_db(fn):\n         ret.append((rtype, record))\n \n     return ret\n+\n+def raise_if_disconnected(fcn):\n+    '''Decorator to catch attempted access to disconnected EPICS channels.'''\n+    @functools.wraps(fcn)\n+    def wrapper(self, *args, **kwargs):\n+        if self.connected:\n+            return fcn(self, *args, **kwargs)\n+        else:\n+            raise Exception('{} is not connected'.format(self.name))","path":"ophyd/utils/epics_pvs.py","position":20,"original_position":20,"commit_id":"115fed790d210745cb01378b1e4811fce8d8d467","original_commit_id":"115fed790d210745cb01378b1e4811fce8d8d467","user":{"login":"dchabot","id":4429592,"avatar_url":"https://avatars.githubusercontent.com/u/4429592?v=3","gravatar_id":"","url":"https://api.github.com/users/dchabot","html_url":"https://github.com/dchabot","followers_url":"https://api.github.com/users/dchabot/followers","following_url":"https://api.github.com/users/dchabot/following{/other_user}","gists_url":"https://api.github.com/users/dchabot/gists{/gist_id}","starred_url":"https://api.github.com/users/dchabot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchabot/subscriptions","organizations_url":"https://api.github.com/users/dchabot/orgs","repos_url":"https://api.github.com/users/dchabot/repos","events_url":"https://api.github.com/users/dchabot/events{/privacy}","received_events_url":"https://api.github.com/users/dchabot/received_events","type":"User","site_admin":false},"body":"Yep, that's ugly. Have you ever seen code in the wild written like that???\r\n\r\nBTW - I meant \"info for human beings to ponder\", not programmatic digestion.\r\n\r\n","created_at":"2015-09-22T20:43:36Z","updated_at":"2015-09-22T20:43:36Z","html_url":"https://github.com/NSLS-II/ophyd/pull/144#discussion_r40141411","pull_request_url":"https://api.github.com/repos/NSLS-II/ophyd/pulls/144","_links":{"self":{"href":"https://api.github.com/repos/NSLS-II/ophyd/pulls/comments/40141411"},"html":{"href":"https://github.com/NSLS-II/ophyd/pull/144#discussion_r40141411"},"pull_request":{"href":"https://api.github.com/repos/NSLS-II/ophyd/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/NSLS-II/ophyd/pulls/144","id":45462862,"html_url":"https://github.com/NSLS-II/ophyd/pull/144","diff_url":"https://github.com/NSLS-II/ophyd/pull/144.diff","patch_url":"https://github.com/NSLS-II/ophyd/pull/144.patch","issue_url":"https://api.github.com/repos/NSLS-II/ophyd/issues/144","number":144,"state":"open","locked":false,"title":"[FIX] CA (dis)connection management","user":{"login":"dchabot","id":4429592,"avatar_url":"https://avatars.githubusercontent.com/u/4429592?v=3","gravatar_id":"","url":"https://api.github.com/users/dchabot","html_url":"https://github.com/dchabot","followers_url":"https://api.github.com/users/dchabot/followers","following_url":"https://api.github.com/users/dchabot/following{/other_user}","gists_url":"https://api.github.com/users/dchabot/gists{/gist_id}","starred_url":"https://api.github.com/users/dchabot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchabot/subscriptions","organizations_url":"https://api.github.com/users/dchabot/orgs","repos_url":"https://api.github.com/users/dchabot/repos","events_url":"https://api.github.com/users/dchabot/events{/privacy}","received_events_url":"https://api.github.com/users/dchabot/received_events","type":"User","site_admin":false},"body":"Addresses #136 and #90\r\n\r\nBasically, avoids the assumption in a couple of `__init__`-ializers that a connection to the controls layer has been made.\r\n\r\nThis means reads/writes to disconnected channels will `raise`, and loading of startup configuration files will not stall if channels cannot be reached initially. Need to have a think about how best to inform users that only M out of N of their devices made a connection by the time the __In [1]:__ prompt lands. Suggestions welcome.\r\n\r\nNOTE: this does _not_ include more graceful handling of swarms of (dis)connects.","created_at":"2015-09-18T23:26:24Z","updated_at":"2015-09-22T20:43:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7794bdf194a5d9bdf849ae05ba5151c7c77815d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NSLS-II/ophyd/pulls/144/commits","review_comments_url":"https://api.github.com/repos/NSLS-II/ophyd/pulls/144/comments","review_comment_url":"https://api.github.com/repos/NSLS-II/ophyd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NSLS-II/ophyd/issues/144/comments","statuses_url":"https://api.github.com/repos/NSLS-II/ophyd/statuses/115fed790d210745cb01378b1e4811fce8d8d467","head":{"label":"dchabot:ca_connections","ref":"ca_connections","sha":"115fed790d210745cb01378b1e4811fce8d8d467","user":{"login":"dchabot","id":4429592,"avatar_url":"https://avatars.githubusercontent.com/u/4429592?v=3","gravatar_id":"","url":"https://api.github.com/users/dchabot","html_url":"https://github.com/dchabot","followers_url":"https://api.github.com/users/dchabot/followers","following_url":"https://api.github.com/users/dchabot/following{/other_user}","gists_url":"https://api.github.com/users/dchabot/gists{/gist_id}","starred_url":"https://api.github.com/users/dchabot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchabot/subscriptions","organizations_url":"https://api.github.com/users/dchabot/orgs","repos_url":"https://api.github.com/users/dchabot/repos","events_url":"https://api.github.com/users/dchabot/events{/privacy}","received_events_url":"https://api.github.com/users/dchabot/received_events","type":"User","site_admin":false},"repo":{"id":39214938,"name":"ophyd","full_name":"dchabot/ophyd","owner":{"login":"dchabot","id":4429592,"avatar_url":"https://avatars.githubusercontent.com/u/4429592?v=3","gravatar_id":"","url":"https://api.github.com/users/dchabot","html_url":"https://github.com/dchabot","followers_url":"https://api.github.com/users/dchabot/followers","following_url":"https://api.github.com/users/dchabot/following{/other_user}","gists_url":"https://api.github.com/users/dchabot/gists{/gist_id}","starred_url":"https://api.github.com/users/dchabot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchabot/subscriptions","organizations_url":"https://api.github.com/users/dchabot/orgs","repos_url":"https://api.github.com/users/dchabot/repos","events_url":"https://api.github.com/users/dchabot/events{/privacy}","received_events_url":"https://api.github.com/users/dchabot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dchabot/ophyd","description":"Python/EPICS based data collection for NSLS-II","fork":true,"url":"https://api.github.com/repos/dchabot/ophyd","forks_url":"https://api.github.com/repos/dchabot/ophyd/forks","keys_url":"https://api.github.com/repos/dchabot/ophyd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dchabot/ophyd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dchabot/ophyd/teams","hooks_url":"https://api.github.com/repos/dchabot/ophyd/hooks","issue_events_url":"https://api.github.com/repos/dchabot/ophyd/issues/events{/number}","events_url":"https://api.github.com/repos/dchabot/ophyd/events","assignees_url":"https://api.github.com/repos/dchabot/ophyd/assignees{/user}","branches_url":"https://api.github.com/repos/dchabot/ophyd/branches{/branch}","tags_url":"https://api.github.com/repos/dchabot/ophyd/tags","blobs_url":"https://api.github.com/repos/dchabot/ophyd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dchabot/ophyd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dchabot/ophyd/git/refs{/sha}","trees_url":"https://api.github.com/repos/dchabot/ophyd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dchabot/ophyd/statuses/{sha}","languages_url":"https://api.github.com/repos/dchabot/ophyd/languages","stargazers_url":"https://api.github.com/repos/dchabot/ophyd/stargazers","contributors_url":"https://api.github.com/repos/dchabot/ophyd/contributors","subscribers_url":"https://api.github.com/repos/dchabot/ophyd/subscribers","subscription_url":"https://api.github.com/repos/dchabot/ophyd/subscription","commits_url":"https://api.github.com/repos/dchabot/ophyd/commits{/sha}","git_commits_url":"https://api.github.com/repos/dchabot/ophyd/git/commits{/sha}","comments_url":"https://api.github.com/repos/dchabot/ophyd/comments{/number}","issue_comment_url":"https://api.github.com/repos/dchabot/ophyd/issues/comments{/number}","contents_url":"https://api.github.com/repos/dchabot/ophyd/contents/{+path}","compare_url":"https://api.github.com/repos/dchabot/ophyd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dchabot/ophyd/merges","archive_url":"https://api.github.com/repos/dchabot/ophyd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dchabot/ophyd/downloads","issues_url":"https://api.github.com/repos/dchabot/ophyd/issues{/number}","pulls_url":"https://api.github.com/repos/dchabot/ophyd/pulls{/number}","milestones_url":"https://api.github.com/repos/dchabot/ophyd/milestones{/number}","notifications_url":"https://api.github.com/repos/dchabot/ophyd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dchabot/ophyd/labels{/name}","releases_url":"https://api.github.com/repos/dchabot/ophyd/releases{/id}","created_at":"2015-07-16T19:00:46Z","updated_at":"2015-07-16T19:00:46Z","pushed_at":"2015-09-22T19:24:36Z","git_url":"git://github.com/dchabot/ophyd.git","ssh_url":"git@github.com:dchabot/ophyd.git","clone_url":"https://github.com/dchabot/ophyd.git","svn_url":"https://github.com/dchabot/ophyd","homepage":"http://nsls-ii.github.io/","size":1676,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NSLS-II:master","ref":"master","sha":"848fcf724fe261f3a0c4bb033b73ed8331ad29b3","user":{"login":"NSLS-II","id":8700262,"avatar_url":"https://avatars.githubusercontent.com/u/8700262?v=3","gravatar_id":"","url":"https://api.github.com/users/NSLS-II","html_url":"https://github.com/NSLS-II","followers_url":"https://api.github.com/users/NSLS-II/followers","following_url":"https://api.github.com/users/NSLS-II/following{/other_user}","gists_url":"https://api.github.com/users/NSLS-II/gists{/gist_id}","starred_url":"https://api.github.com/users/NSLS-II/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSLS-II/subscriptions","organizations_url":"https://api.github.com/users/NSLS-II/orgs","repos_url":"https://api.github.com/users/NSLS-II/repos","events_url":"https://api.github.com/users/NSLS-II/events{/privacy}","received_events_url":"https://api.github.com/users/NSLS-II/received_events","type":"Organization","site_admin":false},"repo":{"id":26235440,"name":"ophyd","full_name":"NSLS-II/ophyd","owner":{"login":"NSLS-II","id":8700262,"avatar_url":"https://avatars.githubusercontent.com/u/8700262?v=3","gravatar_id":"","url":"https://api.github.com/users/NSLS-II","html_url":"https://github.com/NSLS-II","followers_url":"https://api.github.com/users/NSLS-II/followers","following_url":"https://api.github.com/users/NSLS-II/following{/other_user}","gists_url":"https://api.github.com/users/NSLS-II/gists{/gist_id}","starred_url":"https://api.github.com/users/NSLS-II/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSLS-II/subscriptions","organizations_url":"https://api.github.com/users/NSLS-II/orgs","repos_url":"https://api.github.com/users/NSLS-II/repos","events_url":"https://api.github.com/users/NSLS-II/events{/privacy}","received_events_url":"https://api.github.com/users/NSLS-II/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NSLS-II/ophyd","description":"Python/EPICS based data collection for NSLS-II","fork":false,"url":"https://api.github.com/repos/NSLS-II/ophyd","forks_url":"https://api.github.com/repos/NSLS-II/ophyd/forks","keys_url":"https://api.github.com/repos/NSLS-II/ophyd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NSLS-II/ophyd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NSLS-II/ophyd/teams","hooks_url":"https://api.github.com/repos/NSLS-II/ophyd/hooks","issue_events_url":"https://api.github.com/repos/NSLS-II/ophyd/issues/events{/number}","events_url":"https://api.github.com/repos/NSLS-II/ophyd/events","assignees_url":"https://api.github.com/repos/NSLS-II/ophyd/assignees{/user}","branches_url":"https://api.github.com/repos/NSLS-II/ophyd/branches{/branch}","tags_url":"https://api.github.com/repos/NSLS-II/ophyd/tags","blobs_url":"https://api.github.com/repos/NSLS-II/ophyd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NSLS-II/ophyd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NSLS-II/ophyd/git/refs{/sha}","trees_url":"https://api.github.com/repos/NSLS-II/ophyd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NSLS-II/ophyd/statuses/{sha}","languages_url":"https://api.github.com/repos/NSLS-II/ophyd/languages","stargazers_url":"https://api.github.com/repos/NSLS-II/ophyd/stargazers","contributors_url":"https://api.github.com/repos/NSLS-II/ophyd/contributors","subscribers_url":"https://api.github.com/repos/NSLS-II/ophyd/subscribers","subscription_url":"https://api.github.com/repos/NSLS-II/ophyd/subscription","commits_url":"https://api.github.com/repos/NSLS-II/ophyd/commits{/sha}","git_commits_url":"https://api.github.com/repos/NSLS-II/ophyd/git/commits{/sha}","comments_url":"https://api.github.com/repos/NSLS-II/ophyd/comments{/number}","issue_comment_url":"https://api.github.com/repos/NSLS-II/ophyd/issues/comments{/number}","contents_url":"https://api.github.com/repos/NSLS-II/ophyd/contents/{+path}","compare_url":"https://api.github.com/repos/NSLS-II/ophyd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NSLS-II/ophyd/merges","archive_url":"https://api.github.com/repos/NSLS-II/ophyd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NSLS-II/ophyd/downloads","issues_url":"https://api.github.com/repos/NSLS-II/ophyd/issues{/number}","pulls_url":"https://api.github.com/repos/NSLS-II/ophyd/pulls{/number}","milestones_url":"https://api.github.com/repos/NSLS-II/ophyd/milestones{/number}","notifications_url":"https://api.github.com/repos/NSLS-II/ophyd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NSLS-II/ophyd/labels{/name}","releases_url":"https://api.github.com/repos/NSLS-II/ophyd/releases{/id}","created_at":"2014-11-05T19:20:01Z","updated_at":"2015-07-10T16:38:36Z","pushed_at":"2015-09-22T19:24:36Z","git_url":"git://github.com/NSLS-II/ophyd.git","ssh_url":"git@github.com:NSLS-II/ophyd.git","clone_url":"https://github.com/NSLS-II/ophyd.git","svn_url":"https://github.com/NSLS-II/ophyd","homepage":"http://nsls-ii.github.io/","size":5368,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":47,"forks":10,"open_issues":47,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NSLS-II/ophyd/pulls/144"},"html":{"href":"https://github.com/NSLS-II/ophyd/pull/144"},"issue":{"href":"https://api.github.com/repos/NSLS-II/ophyd/issues/144"},"comments":{"href":"https://api.github.com/repos/NSLS-II/ophyd/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/NSLS-II/ophyd/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/NSLS-II/ophyd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NSLS-II/ophyd/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/NSLS-II/ophyd/statuses/115fed790d210745cb01378b1e4811fce8d8d467"}}}}