{"action":"created","comment":{"url":"https://api.github.com/repos/nco/pynco/pulls/comments/77704218","id":77704218,"diff_hunk":"@@ -0,0 +1,268 @@\n+import os\n+import re\n+import sys\n+import numpy as np\n+\n+DEBUG=1\n+\n+# check mode\n+validModes = dict({\n+    'append': 'a',\n+    'create': 'c',\n+    'delete': 'd',\n+    'modify': 'm',\n+    'nappend': 'n',\n+    'overwrite': 'o'\n+})\n+\n+# netCDF type names\n+netTypes = dict({\n+    'NC_FLOAT': 'f',\n+    'NC_DOUBLE': 'd',\n+    'NC_INT': 'i',\n+    'NC_SHORT': 's',\n+    'NC_CHAR': 'c',\n+    'NC_BYTE': 'b',\n+    'NC_UBYTE': 'ub',\n+    'NC_USHORT': 'us',\n+    'NC_UINT': 'ui',\n+    'NC_INT64': 'll',\n+    'NC_UINT64': 'ull',\n+    'NC_STRING': 'sng'\n+})\n+\n+# numpy type names\n+npTypes = dict({\n+    'float32': 'f',\n+    'float64': 'd',\n+    'int32': 'i',\n+    'int16': 's',\n+    'char': 'c',\n+    'byte': 'b',\n+    'ubyte': 'ub',\n+    'int8' : 'b',\n+    'uint8' : 'ub',\n+    'uint16': 'us',\n+    'uint32': 'ui',\n+    'int64': 'll',\n+    'uint64': 'ull',\n+    'string': 'sng'\n+})\n+\n+npTypesNP = dict({\n+    'float32' : np.float32, \n+    'float'   : np.float32 ,\n+    'f'       : np.float32 ,\n+    'float64' : np.float64,\n+    'double'  : np.float64,\n+    'd'       : np.float64,\n+    'int32'   : np.int32,\n+    'i'       : np.int32,\n+    'l'       : np.int32,\n+    'int16'   : np.int16,\n+    's'       : np.int16,\n+    'str'     : str,\n+    'char'    : str,\n+    'c'       : str,\n+    'string'  : str,  \n+    'sng'     : str,  \n+    'byte'    : np.byte,\n+    'b'       : np.byte,\n+    'ubyte'   : np.ubyte,\n+    'ub'      : np.ubyte,\n+    'int8'    : np.byte,\n+    'uint8'   : np.ubyte,\n+    'uint16'  : np.uint16,\n+    'us'      : np.uint16,\n+    'uint32'  : np.uint32,\n+    'u'       : np.uint32,\n+    'ui'      : np.uint32,\n+    'ul'      : np.uint32,\n+    'int64'   : np.int64,\n+    'll'      : np.int64,\n+    'uint64'  : np.uint64,\n+    'ull'     : np.uint64\n+})\n+\n+\n+\n+__prog__ = os.path.splitext(os.path.basename(__file__))[0]\n+\n+\n+class atted(object):\n+\n+    def __init__(self, mode='overwrite',attName=\"\",varName=\"\", Value=None,  sType=None,**kwargs):\n+    #def __init__(self, **kwargs):\n+        mode = kwargs.pop('mode', mode)\n+        attName = kwargs.pop('attName', attName)\n+        varName = kwargs.pop('varName', varName)\n+        Value = kwargs.pop('Value', Value)\n+        sType = kwargs.pop('sType',sType )\n+            \n+        if mode in validModes:\n+           mode=validModes[mode]  \n+        elif mode in validModes.keys():\n+           pass\n+        else:\n+           raise Exception('{0}: mode \"{1}\" not found'.format(\"atted()\",\"atted():\",mode))\n+        \n+        if attName==None or len(attName)==0: \n+            raise Exception ('{0}: attName zero length\\n'.format(\"atted()\"))","path":"nco/custom.py","position":110,"original_position":110,"commit_id":"d9dbb73e927cab7864a2b4315d93670a9ef328e3","original_commit_id":"d9dbb73e927cab7864a2b4315d93670a9ef328e3","user":{"login":"jhamman","id":2443309,"avatar_url":"https://avatars.githubusercontent.com/u/2443309?v=3","gravatar_id":"","url":"https://api.github.com/users/jhamman","html_url":"https://github.com/jhamman","followers_url":"https://api.github.com/users/jhamman/followers","following_url":"https://api.github.com/users/jhamman/following{/other_user}","gists_url":"https://api.github.com/users/jhamman/gists{/gist_id}","starred_url":"https://api.github.com/users/jhamman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhamman/subscriptions","organizations_url":"https://api.github.com/users/jhamman/orgs","repos_url":"https://api.github.com/users/jhamman/repos","events_url":"https://api.github.com/users/jhamman/events{/privacy}","received_events_url":"https://api.github.com/users/jhamman/received_events","type":"User","site_admin":false},"body":"the proper way to compare to `None` uses `is`:\r\n\r\n```Python\r\nif att_name is None or len(att_name) == 0: \r\n```\r\n\r\nThis could also be written as:\r\n```Python\r\nif not att_name:\r\n    raise ValueError('att_name is required'\"))\r\n```","created_at":"2016-09-06T19:42:01Z","updated_at":"2016-09-06T19:42:01Z","html_url":"https://github.com/nco/pynco/pull/17#discussion_r77704218","pull_request_url":"https://api.github.com/repos/nco/pynco/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/nco/pynco/pulls/comments/77704218"},"html":{"href":"https://github.com/nco/pynco/pull/17#discussion_r77704218"},"pull_request":{"href":"https://api.github.com/repos/nco/pynco/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/nco/pynco/pulls/17","id":82538171,"html_url":"https://github.com/nco/pynco/pull/17","diff_url":"https://github.com/nco/pynco/pull/17.diff","patch_url":"https://github.com/nco/pynco/pull/17.patch","issue_url":"https://api.github.com/repos/nco/pynco/issues/17","number":17,"state":"open","locked":false,"title":"Hmb1 master","user":{"login":"hmb1","id":6428656,"avatar_url":"https://avatars.githubusercontent.com/u/6428656?v=3","gravatar_id":"","url":"https://api.github.com/users/hmb1","html_url":"https://github.com/hmb1","followers_url":"https://api.github.com/users/hmb1/followers","following_url":"https://api.github.com/users/hmb1/following{/other_user}","gists_url":"https://api.github.com/users/hmb1/gists{/gist_id}","starred_url":"https://api.github.com/users/hmb1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmb1/subscriptions","organizations_url":"https://api.github.com/users/hmb1/orgs","repos_url":"https://api.github.com/users/hmb1/repos","events_url":"https://api.github.com/users/hmb1/events{/privacy}","received_events_url":"https://api.github.com/users/hmb1/received_events","type":"User","site_admin":false},"body":"Hi Joe,\r\n I you could review and comment that would be grand.\r\n.Thanks Henry","created_at":"2016-08-24T13:06:01Z","updated_at":"2016-09-06T19:42:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"858509c97858840c3196dd2c7976515cfccad2d5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nco/pynco/pulls/17/commits","review_comments_url":"https://api.github.com/repos/nco/pynco/pulls/17/comments","review_comment_url":"https://api.github.com/repos/nco/pynco/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nco/pynco/issues/17/comments","statuses_url":"https://api.github.com/repos/nco/pynco/statuses/d9dbb73e927cab7864a2b4315d93670a9ef328e3","head":{"label":"hmb1:hmb1-master","ref":"hmb1-master","sha":"d9dbb73e927cab7864a2b4315d93670a9ef328e3","user":{"login":"hmb1","id":6428656,"avatar_url":"https://avatars.githubusercontent.com/u/6428656?v=3","gravatar_id":"","url":"https://api.github.com/users/hmb1","html_url":"https://github.com/hmb1","followers_url":"https://api.github.com/users/hmb1/followers","following_url":"https://api.github.com/users/hmb1/following{/other_user}","gists_url":"https://api.github.com/users/hmb1/gists{/gist_id}","starred_url":"https://api.github.com/users/hmb1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmb1/subscriptions","organizations_url":"https://api.github.com/users/hmb1/orgs","repos_url":"https://api.github.com/users/hmb1/repos","events_url":"https://api.github.com/users/hmb1/events{/privacy}","received_events_url":"https://api.github.com/users/hmb1/received_events","type":"User","site_admin":false},"repo":{"id":66464188,"name":"pynco","full_name":"hmb1/pynco","owner":{"login":"hmb1","id":6428656,"avatar_url":"https://avatars.githubusercontent.com/u/6428656?v=3","gravatar_id":"","url":"https://api.github.com/users/hmb1","html_url":"https://github.com/hmb1","followers_url":"https://api.github.com/users/hmb1/followers","following_url":"https://api.github.com/users/hmb1/following{/other_user}","gists_url":"https://api.github.com/users/hmb1/gists{/gist_id}","starred_url":"https://api.github.com/users/hmb1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmb1/subscriptions","organizations_url":"https://api.github.com/users/hmb1/orgs","repos_url":"https://api.github.com/users/hmb1/repos","events_url":"https://api.github.com/users/hmb1/events{/privacy}","received_events_url":"https://api.github.com/users/hmb1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hmb1/pynco","description":"Python bindings for NCO","fork":true,"url":"https://api.github.com/repos/hmb1/pynco","forks_url":"https://api.github.com/repos/hmb1/pynco/forks","keys_url":"https://api.github.com/repos/hmb1/pynco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmb1/pynco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmb1/pynco/teams","hooks_url":"https://api.github.com/repos/hmb1/pynco/hooks","issue_events_url":"https://api.github.com/repos/hmb1/pynco/issues/events{/number}","events_url":"https://api.github.com/repos/hmb1/pynco/events","assignees_url":"https://api.github.com/repos/hmb1/pynco/assignees{/user}","branches_url":"https://api.github.com/repos/hmb1/pynco/branches{/branch}","tags_url":"https://api.github.com/repos/hmb1/pynco/tags","blobs_url":"https://api.github.com/repos/hmb1/pynco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmb1/pynco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmb1/pynco/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmb1/pynco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmb1/pynco/statuses/{sha}","languages_url":"https://api.github.com/repos/hmb1/pynco/languages","stargazers_url":"https://api.github.com/repos/hmb1/pynco/stargazers","contributors_url":"https://api.github.com/repos/hmb1/pynco/contributors","subscribers_url":"https://api.github.com/repos/hmb1/pynco/subscribers","subscription_url":"https://api.github.com/repos/hmb1/pynco/subscription","commits_url":"https://api.github.com/repos/hmb1/pynco/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmb1/pynco/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmb1/pynco/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmb1/pynco/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmb1/pynco/contents/{+path}","compare_url":"https://api.github.com/repos/hmb1/pynco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmb1/pynco/merges","archive_url":"https://api.github.com/repos/hmb1/pynco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmb1/pynco/downloads","issues_url":"https://api.github.com/repos/hmb1/pynco/issues{/number}","pulls_url":"https://api.github.com/repos/hmb1/pynco/pulls{/number}","milestones_url":"https://api.github.com/repos/hmb1/pynco/milestones{/number}","notifications_url":"https://api.github.com/repos/hmb1/pynco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmb1/pynco/labels{/name}","releases_url":"https://api.github.com/repos/hmb1/pynco/releases{/id}","deployments_url":"https://api.github.com/repos/hmb1/pynco/deployments","created_at":"2016-08-24T13:00:02Z","updated_at":"2016-08-24T13:00:03Z","pushed_at":"2016-09-01T11:43:56Z","git_url":"git://github.com/hmb1/pynco.git","ssh_url":"git@github.com:hmb1/pynco.git","clone_url":"https://github.com/hmb1/pynco.git","svn_url":"https://github.com/hmb1/pynco","homepage":"http://pynco.readthedocs.org","size":92,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"nco:master","ref":"master","sha":"45396d1206b406c4dfc742f1a5fb1994d7c8582b","user":{"login":"nco","id":13952264,"avatar_url":"https://avatars.githubusercontent.com/u/13952264?v=3","gravatar_id":"","url":"https://api.github.com/users/nco","html_url":"https://github.com/nco","followers_url":"https://api.github.com/users/nco/followers","following_url":"https://api.github.com/users/nco/following{/other_user}","gists_url":"https://api.github.com/users/nco/gists{/gist_id}","starred_url":"https://api.github.com/users/nco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nco/subscriptions","organizations_url":"https://api.github.com/users/nco/orgs","repos_url":"https://api.github.com/users/nco/repos","events_url":"https://api.github.com/users/nco/events{/privacy}","received_events_url":"https://api.github.com/users/nco/received_events","type":"Organization","site_admin":false},"repo":{"id":15876150,"name":"pynco","full_name":"nco/pynco","owner":{"login":"nco","id":13952264,"avatar_url":"https://avatars.githubusercontent.com/u/13952264?v=3","gravatar_id":"","url":"https://api.github.com/users/nco","html_url":"https://github.com/nco","followers_url":"https://api.github.com/users/nco/followers","following_url":"https://api.github.com/users/nco/following{/other_user}","gists_url":"https://api.github.com/users/nco/gists{/gist_id}","starred_url":"https://api.github.com/users/nco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nco/subscriptions","organizations_url":"https://api.github.com/users/nco/orgs","repos_url":"https://api.github.com/users/nco/repos","events_url":"https://api.github.com/users/nco/events{/privacy}","received_events_url":"https://api.github.com/users/nco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nco/pynco","description":"Python bindings for NCO","fork":false,"url":"https://api.github.com/repos/nco/pynco","forks_url":"https://api.github.com/repos/nco/pynco/forks","keys_url":"https://api.github.com/repos/nco/pynco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nco/pynco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nco/pynco/teams","hooks_url":"https://api.github.com/repos/nco/pynco/hooks","issue_events_url":"https://api.github.com/repos/nco/pynco/issues/events{/number}","events_url":"https://api.github.com/repos/nco/pynco/events","assignees_url":"https://api.github.com/repos/nco/pynco/assignees{/user}","branches_url":"https://api.github.com/repos/nco/pynco/branches{/branch}","tags_url":"https://api.github.com/repos/nco/pynco/tags","blobs_url":"https://api.github.com/repos/nco/pynco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nco/pynco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nco/pynco/git/refs{/sha}","trees_url":"https://api.github.com/repos/nco/pynco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nco/pynco/statuses/{sha}","languages_url":"https://api.github.com/repos/nco/pynco/languages","stargazers_url":"https://api.github.com/repos/nco/pynco/stargazers","contributors_url":"https://api.github.com/repos/nco/pynco/contributors","subscribers_url":"https://api.github.com/repos/nco/pynco/subscribers","subscription_url":"https://api.github.com/repos/nco/pynco/subscription","commits_url":"https://api.github.com/repos/nco/pynco/commits{/sha}","git_commits_url":"https://api.github.com/repos/nco/pynco/git/commits{/sha}","comments_url":"https://api.github.com/repos/nco/pynco/comments{/number}","issue_comment_url":"https://api.github.com/repos/nco/pynco/issues/comments{/number}","contents_url":"https://api.github.com/repos/nco/pynco/contents/{+path}","compare_url":"https://api.github.com/repos/nco/pynco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nco/pynco/merges","archive_url":"https://api.github.com/repos/nco/pynco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nco/pynco/downloads","issues_url":"https://api.github.com/repos/nco/pynco/issues{/number}","pulls_url":"https://api.github.com/repos/nco/pynco/pulls{/number}","milestones_url":"https://api.github.com/repos/nco/pynco/milestones{/number}","notifications_url":"https://api.github.com/repos/nco/pynco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nco/pynco/labels{/name}","releases_url":"https://api.github.com/repos/nco/pynco/releases{/id}","deployments_url":"https://api.github.com/repos/nco/pynco/deployments","created_at":"2014-01-13T17:41:59Z","updated_at":"2016-08-24T12:59:33Z","pushed_at":"2016-08-31T13:22:28Z","git_url":"git://github.com/nco/pynco.git","ssh_url":"git@github.com:nco/pynco.git","clone_url":"https://github.com/nco/pynco.git","svn_url":"https://github.com/nco/pynco","homepage":"http://pynco.readthedocs.org","size":81,"stargazers_count":23,"watchers_count":23,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":4,"forks":9,"open_issues":4,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nco/pynco/pulls/17"},"html":{"href":"https://github.com/nco/pynco/pull/17"},"issue":{"href":"https://api.github.com/repos/nco/pynco/issues/17"},"comments":{"href":"https://api.github.com/repos/nco/pynco/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/nco/pynco/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/nco/pynco/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nco/pynco/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/nco/pynco/statuses/d9dbb73e927cab7864a2b4315d93670a9ef328e3"}}}}
{"actor":{"display_login":"jhamman"}}