{"action":"created","comment":{"url":"https://api.github.com/repos/mperrin/poppy/pulls/comments/37303832","id":37303832,"diff_hunk":"@@ -2158,17 +2158,15 @@ def __init__(self, name=\"unnamed optic\", transmission=None, opd= None, opdunits=\n                     _log.error(\"No opdunit keyword supplied, and BUNIT keyword not found in header. Cannot determine OPD units\")\n                     raise Exception(\"No opdunit keyword supplied, and BUNIT keyword not found in header. Cannot determine OPD units.\")\n \n-\n-            if opdunits.lower().endswith('s'): opdunits = opdunits[:-1] # drop trailing s if present\n-            if opdunits.lower() == 'meter' or opdunits.lower() == 'm':\n-                pass # no need to rescale\n-            elif opdunits.lower() == 'micron' or opdunits.lower() == 'um' or opdunits.lower() == 'micrometer':\n+            opdunits = opdunits.lower()\n+            # rescale to meters if necessary\n+            if opdunits in ('meter', 'meters', 'm'):\n+                pass\n+            elif opdunits in ('micron', 'microns', 'um', 'micrometer', 'micrometers'):","path":"poppy/poppy_core.py","position":22,"original_position":22,"commit_id":"ab1f2922458bc8db2870b9f6f9d10d218359b6ef","original_commit_id":"ab1f2922458bc8db2870b9f6f9d10d218359b6ef","user":{"login":"mperrin","id":1151745,"avatar_url":"https://avatars.githubusercontent.com/u/1151745?v=3","gravatar_id":"","url":"https://api.github.com/users/mperrin","html_url":"https://github.com/mperrin","followers_url":"https://api.github.com/users/mperrin/followers","following_url":"https://api.github.com/users/mperrin/following{/other_user}","gists_url":"https://api.github.com/users/mperrin/gists{/gist_id}","starred_url":"https://api.github.com/users/mperrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mperrin/subscriptions","organizations_url":"https://api.github.com/users/mperrin/orgs","repos_url":"https://api.github.com/users/mperrin/repos","events_url":"https://api.github.com/users/mperrin/events{/privacy}","received_events_url":"https://api.github.com/users/mperrin/received_events","type":"User","site_admin":false},"body":"OK, that's fine. This is micro-optimizing something that's not at all computationally demanding :-) I was mostly just idly curious since I couldn't figure out any technical need for this associated with the BUNIT changes.","created_at":"2015-08-18T14:25:15Z","updated_at":"2015-08-18T14:25:15Z","html_url":"https://github.com/mperrin/poppy/pull/105#discussion_r37303832","pull_request_url":"https://api.github.com/repos/mperrin/poppy/pulls/105","_links":{"self":{"href":"https://api.github.com/repos/mperrin/poppy/pulls/comments/37303832"},"html":{"href":"https://github.com/mperrin/poppy/pull/105#discussion_r37303832"},"pull_request":{"href":"https://api.github.com/repos/mperrin/poppy/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/mperrin/poppy/pulls/105","id":42603179,"html_url":"https://github.com/mperrin/poppy/pull/105","diff_url":"https://github.com/mperrin/poppy/pull/105.diff","patch_url":"https://github.com/mperrin/poppy/pull/105.patch","issue_url":"https://api.github.com/repos/mperrin/poppy/issues/105","number":105,"state":"open","locked":false,"title":"Add a hook for inserting aberration optics after the pupil","user":{"login":"josePhoenix","id":172886,"avatar_url":"https://avatars.githubusercontent.com/u/172886?v=3","gravatar_id":"","url":"https://api.github.com/users/josePhoenix","html_url":"https://github.com/josePhoenix","followers_url":"https://api.github.com/users/josePhoenix/followers","following_url":"https://api.github.com/users/josePhoenix/following{/other_user}","gists_url":"https://api.github.com/users/josePhoenix/gists{/gist_id}","starred_url":"https://api.github.com/users/josePhoenix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josePhoenix/subscriptions","organizations_url":"https://api.github.com/users/josePhoenix/orgs","repos_url":"https://api.github.com/users/josePhoenix/repos","events_url":"https://api.github.com/users/josePhoenix/events{/privacy}","received_events_url":"https://api.github.com/users/josePhoenix/received_events","type":"User","site_admin":false},"body":"Adds `poppy.Instrument.get_aberrations` which returns a `poppy.OpticalElement` or `None`. Used in the implementation of the WFIRST WFI model.\r\n\r\nAdditionally, lets POPPY select the units of OPD based on a FITS header keyword instead of forcing them to be microns.","created_at":"2015-08-17T15:50:50Z","updated_at":"2015-08-18T14:25:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5da20e70a0c1238c1dce7f2c36602ef97e19c2a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mperrin/poppy/pulls/105/commits","review_comments_url":"https://api.github.com/repos/mperrin/poppy/pulls/105/comments","review_comment_url":"https://api.github.com/repos/mperrin/poppy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mperrin/poppy/issues/105/comments","statuses_url":"https://api.github.com/repos/mperrin/poppy/statuses/ab1f2922458bc8db2870b9f6f9d10d218359b6ef","head":{"label":"josePhoenix:field_dependence_hook","ref":"field_dependence_hook","sha":"ab1f2922458bc8db2870b9f6f9d10d218359b6ef","user":{"login":"josePhoenix","id":172886,"avatar_url":"https://avatars.githubusercontent.com/u/172886?v=3","gravatar_id":"","url":"https://api.github.com/users/josePhoenix","html_url":"https://github.com/josePhoenix","followers_url":"https://api.github.com/users/josePhoenix/followers","following_url":"https://api.github.com/users/josePhoenix/following{/other_user}","gists_url":"https://api.github.com/users/josePhoenix/gists{/gist_id}","starred_url":"https://api.github.com/users/josePhoenix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josePhoenix/subscriptions","organizations_url":"https://api.github.com/users/josePhoenix/orgs","repos_url":"https://api.github.com/users/josePhoenix/repos","events_url":"https://api.github.com/users/josePhoenix/events{/privacy}","received_events_url":"https://api.github.com/users/josePhoenix/received_events","type":"User","site_admin":false},"repo":{"id":24774662,"name":"poppy","full_name":"josePhoenix/poppy","owner":{"login":"josePhoenix","id":172886,"avatar_url":"https://avatars.githubusercontent.com/u/172886?v=3","gravatar_id":"","url":"https://api.github.com/users/josePhoenix","html_url":"https://github.com/josePhoenix","followers_url":"https://api.github.com/users/josePhoenix/followers","following_url":"https://api.github.com/users/josePhoenix/following{/other_user}","gists_url":"https://api.github.com/users/josePhoenix/gists{/gist_id}","starred_url":"https://api.github.com/users/josePhoenix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josePhoenix/subscriptions","organizations_url":"https://api.github.com/users/josePhoenix/orgs","repos_url":"https://api.github.com/users/josePhoenix/repos","events_url":"https://api.github.com/users/josePhoenix/events{/privacy}","received_events_url":"https://api.github.com/users/josePhoenix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/josePhoenix/poppy","description":"Physical Optics Propagation in Python","fork":true,"url":"https://api.github.com/repos/josePhoenix/poppy","forks_url":"https://api.github.com/repos/josePhoenix/poppy/forks","keys_url":"https://api.github.com/repos/josePhoenix/poppy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josePhoenix/poppy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josePhoenix/poppy/teams","hooks_url":"https://api.github.com/repos/josePhoenix/poppy/hooks","issue_events_url":"https://api.github.com/repos/josePhoenix/poppy/issues/events{/number}","events_url":"https://api.github.com/repos/josePhoenix/poppy/events","assignees_url":"https://api.github.com/repos/josePhoenix/poppy/assignees{/user}","branches_url":"https://api.github.com/repos/josePhoenix/poppy/branches{/branch}","tags_url":"https://api.github.com/repos/josePhoenix/poppy/tags","blobs_url":"https://api.github.com/repos/josePhoenix/poppy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josePhoenix/poppy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josePhoenix/poppy/git/refs{/sha}","trees_url":"https://api.github.com/repos/josePhoenix/poppy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josePhoenix/poppy/statuses/{sha}","languages_url":"https://api.github.com/repos/josePhoenix/poppy/languages","stargazers_url":"https://api.github.com/repos/josePhoenix/poppy/stargazers","contributors_url":"https://api.github.com/repos/josePhoenix/poppy/contributors","subscribers_url":"https://api.github.com/repos/josePhoenix/poppy/subscribers","subscription_url":"https://api.github.com/repos/josePhoenix/poppy/subscription","commits_url":"https://api.github.com/repos/josePhoenix/poppy/commits{/sha}","git_commits_url":"https://api.github.com/repos/josePhoenix/poppy/git/commits{/sha}","comments_url":"https://api.github.com/repos/josePhoenix/poppy/comments{/number}","issue_comment_url":"https://api.github.com/repos/josePhoenix/poppy/issues/comments{/number}","contents_url":"https://api.github.com/repos/josePhoenix/poppy/contents/{+path}","compare_url":"https://api.github.com/repos/josePhoenix/poppy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josePhoenix/poppy/merges","archive_url":"https://api.github.com/repos/josePhoenix/poppy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josePhoenix/poppy/downloads","issues_url":"https://api.github.com/repos/josePhoenix/poppy/issues{/number}","pulls_url":"https://api.github.com/repos/josePhoenix/poppy/pulls{/number}","milestones_url":"https://api.github.com/repos/josePhoenix/poppy/milestones{/number}","notifications_url":"https://api.github.com/repos/josePhoenix/poppy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josePhoenix/poppy/labels{/name}","releases_url":"https://api.github.com/repos/josePhoenix/poppy/releases{/id}","created_at":"2014-10-03T21:38:08Z","updated_at":"2015-05-06T18:13:51Z","pushed_at":"2015-08-17T15:48:27Z","git_url":"git://github.com/josePhoenix/poppy.git","ssh_url":"git@github.com:josePhoenix/poppy.git","clone_url":"https://github.com/josePhoenix/poppy.git","svn_url":"https://github.com/josePhoenix/poppy","homepage":null,"size":7075,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mperrin:master","ref":"master","sha":"7307080b2b68818c7042e557aba504da93e7c00e","user":{"login":"mperrin","id":1151745,"avatar_url":"https://avatars.githubusercontent.com/u/1151745?v=3","gravatar_id":"","url":"https://api.github.com/users/mperrin","html_url":"https://github.com/mperrin","followers_url":"https://api.github.com/users/mperrin/followers","following_url":"https://api.github.com/users/mperrin/following{/other_user}","gists_url":"https://api.github.com/users/mperrin/gists{/gist_id}","starred_url":"https://api.github.com/users/mperrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mperrin/subscriptions","organizations_url":"https://api.github.com/users/mperrin/orgs","repos_url":"https://api.github.com/users/mperrin/repos","events_url":"https://api.github.com/users/mperrin/events{/privacy}","received_events_url":"https://api.github.com/users/mperrin/received_events","type":"User","site_admin":false},"repo":{"id":4206587,"name":"poppy","full_name":"mperrin/poppy","owner":{"login":"mperrin","id":1151745,"avatar_url":"https://avatars.githubusercontent.com/u/1151745?v=3","gravatar_id":"","url":"https://api.github.com/users/mperrin","html_url":"https://github.com/mperrin","followers_url":"https://api.github.com/users/mperrin/followers","following_url":"https://api.github.com/users/mperrin/following{/other_user}","gists_url":"https://api.github.com/users/mperrin/gists{/gist_id}","starred_url":"https://api.github.com/users/mperrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mperrin/subscriptions","organizations_url":"https://api.github.com/users/mperrin/orgs","repos_url":"https://api.github.com/users/mperrin/repos","events_url":"https://api.github.com/users/mperrin/events{/privacy}","received_events_url":"https://api.github.com/users/mperrin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mperrin/poppy","description":"Physical Optics Propagation in Python","fork":false,"url":"https://api.github.com/repos/mperrin/poppy","forks_url":"https://api.github.com/repos/mperrin/poppy/forks","keys_url":"https://api.github.com/repos/mperrin/poppy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mperrin/poppy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mperrin/poppy/teams","hooks_url":"https://api.github.com/repos/mperrin/poppy/hooks","issue_events_url":"https://api.github.com/repos/mperrin/poppy/issues/events{/number}","events_url":"https://api.github.com/repos/mperrin/poppy/events","assignees_url":"https://api.github.com/repos/mperrin/poppy/assignees{/user}","branches_url":"https://api.github.com/repos/mperrin/poppy/branches{/branch}","tags_url":"https://api.github.com/repos/mperrin/poppy/tags","blobs_url":"https://api.github.com/repos/mperrin/poppy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mperrin/poppy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mperrin/poppy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mperrin/poppy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mperrin/poppy/statuses/{sha}","languages_url":"https://api.github.com/repos/mperrin/poppy/languages","stargazers_url":"https://api.github.com/repos/mperrin/poppy/stargazers","contributors_url":"https://api.github.com/repos/mperrin/poppy/contributors","subscribers_url":"https://api.github.com/repos/mperrin/poppy/subscribers","subscription_url":"https://api.github.com/repos/mperrin/poppy/subscription","commits_url":"https://api.github.com/repos/mperrin/poppy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mperrin/poppy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mperrin/poppy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mperrin/poppy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mperrin/poppy/contents/{+path}","compare_url":"https://api.github.com/repos/mperrin/poppy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mperrin/poppy/merges","archive_url":"https://api.github.com/repos/mperrin/poppy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mperrin/poppy/downloads","issues_url":"https://api.github.com/repos/mperrin/poppy/issues{/number}","pulls_url":"https://api.github.com/repos/mperrin/poppy/pulls{/number}","milestones_url":"https://api.github.com/repos/mperrin/poppy/milestones{/number}","notifications_url":"https://api.github.com/repos/mperrin/poppy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mperrin/poppy/labels{/name}","releases_url":"https://api.github.com/repos/mperrin/poppy/releases{/id}","created_at":"2012-05-02T19:09:02Z","updated_at":"2015-05-01T04:03:47Z","pushed_at":"2015-08-18T13:38:45Z","git_url":"git://github.com/mperrin/poppy.git","ssh_url":"git@github.com:mperrin/poppy.git","clone_url":"https://github.com/mperrin/poppy.git","svn_url":"https://github.com/mperrin/poppy","homepage":null,"size":7388,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":26,"forks":7,"open_issues":26,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mperrin/poppy/pulls/105"},"html":{"href":"https://github.com/mperrin/poppy/pull/105"},"issue":{"href":"https://api.github.com/repos/mperrin/poppy/issues/105"},"comments":{"href":"https://api.github.com/repos/mperrin/poppy/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/mperrin/poppy/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/mperrin/poppy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mperrin/poppy/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/mperrin/poppy/statuses/ab1f2922458bc8db2870b9f6f9d10d218359b6ef"}}}}