{"action":"created","comment":{"url":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/comments/69101707","id":69101707,"diff_hunk":"@@ -233,14 +248,20 @@ def convert(cls, value, unit, axis):\n                 return value\n             first_value = value\n \n-        if not hasattr(first_value, 'calendar'):\n-            raise ValueError('A \"calendar\" attribute must be attached to '\n-                             'netcdftime object to understand them properly.')\n-        return netcdftime.date2num(value, cls.standard_unit,\n-                                   calendar=first_value.calendar)\n+        if not isinstance(first_value.datetime, netcdftime.datetime):","path":"nc_time_axis/__init__.py","position":73,"original_position":73,"commit_id":"6df38df83e8497bbd24522a932e442d1dfa1c041","original_commit_id":"6df38df83e8497bbd24522a932e442d1dfa1c041","user":{"login":"lbdreyer","id":8101163,"avatar_url":"https://avatars.githubusercontent.com/u/8101163?v=3","gravatar_id":"","url":"https://api.github.com/users/lbdreyer","html_url":"https://github.com/lbdreyer","followers_url":"https://api.github.com/users/lbdreyer/followers","following_url":"https://api.github.com/users/lbdreyer/following{/other_user}","gists_url":"https://api.github.com/users/lbdreyer/gists{/gist_id}","starred_url":"https://api.github.com/users/lbdreyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbdreyer/subscriptions","organizations_url":"https://api.github.com/users/lbdreyer/orgs","repos_url":"https://api.github.com/users/lbdreyer/repos","events_url":"https://api.github.com/users/lbdreyer/events{/privacy}","received_events_url":"https://api.github.com/users/lbdreyer/received_events","type":"User","site_admin":false},"body":"I think I was counting (incorrectly) on the fact that someone would never use `NetCDFTimeConvert` directly, that it was only there for matplotlib to make use of. Since `NetCDFTimeConvert` had been registered with in the `munits.regristry` with the object `CalendarDateTime`, I thought I could assume that a `CalendarDateTime` object would only ever be passed to this.\r\nI think I'm wrong in that assumption so I'm going to add a check that it is of type `CalendarDateTime`.","created_at":"2016-06-30T09:32:19Z","updated_at":"2016-06-30T09:32:19Z","html_url":"https://github.com/SciTools/nc-time-axis/pull/12#discussion_r69101707","pull_request_url":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/comments/69101707"},"html":{"href":"https://github.com/SciTools/nc-time-axis/pull/12#discussion_r69101707"},"pull_request":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/12","id":75670979,"html_url":"https://github.com/SciTools/nc-time-axis/pull/12","diff_url":"https://github.com/SciTools/nc-time-axis/pull/12.diff","patch_url":"https://github.com/SciTools/nc-time-axis/pull/12.patch","issue_url":"https://api.github.com/repos/SciTools/nc-time-axis/issues/12","number":12,"state":"open","locked":false,"title":"Use container of nc datetime and calendar.","user":{"login":"lbdreyer","id":8101163,"avatar_url":"https://avatars.githubusercontent.com/u/8101163?v=3","gravatar_id":"","url":"https://api.github.com/users/lbdreyer","html_url":"https://github.com/lbdreyer","followers_url":"https://api.github.com/users/lbdreyer/followers","following_url":"https://api.github.com/users/lbdreyer/following{/other_user}","gists_url":"https://api.github.com/users/lbdreyer/gists{/gist_id}","starred_url":"https://api.github.com/users/lbdreyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbdreyer/subscriptions","organizations_url":"https://api.github.com/users/lbdreyer/orgs","repos_url":"https://api.github.com/users/lbdreyer/repos","events_url":"https://api.github.com/users/lbdreyer/events{/privacy}","received_events_url":"https://api.github.com/users/lbdreyer/received_events","type":"User","site_admin":false},"body":"To integrate this with Iris, we want to make use of the newer version of netcdf4.\r\n\r\nNew netcdf4 has slightly different behaviour, e.g. differing number results; not allowing you to add a calendar attribute to netcdftime.datetime object (See [PR6 comment ](https://github.com/SciTools/nc-time-axis/pull/6#issuecomment-229050703) for more detail)\r\n\r\nThis adds a container for the netcdftime.datetime object and associated calendar object, then registers that container with matplotlib.units instead.","created_at":"2016-06-29T15:36:15Z","updated_at":"2016-06-30T09:32:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b36e196ca70dc17dde857454ea5a6767ce7269d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/12/commits","review_comments_url":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/12/comments","review_comment_url":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SciTools/nc-time-axis/issues/12/comments","statuses_url":"https://api.github.com/repos/SciTools/nc-time-axis/statuses/6df38df83e8497bbd24522a932e442d1dfa1c041","head":{"label":"lbdreyer:update_nc","ref":"update_nc","sha":"6df38df83e8497bbd24522a932e442d1dfa1c041","user":{"login":"lbdreyer","id":8101163,"avatar_url":"https://avatars.githubusercontent.com/u/8101163?v=3","gravatar_id":"","url":"https://api.github.com/users/lbdreyer","html_url":"https://github.com/lbdreyer","followers_url":"https://api.github.com/users/lbdreyer/followers","following_url":"https://api.github.com/users/lbdreyer/following{/other_user}","gists_url":"https://api.github.com/users/lbdreyer/gists{/gist_id}","starred_url":"https://api.github.com/users/lbdreyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbdreyer/subscriptions","organizations_url":"https://api.github.com/users/lbdreyer/orgs","repos_url":"https://api.github.com/users/lbdreyer/repos","events_url":"https://api.github.com/users/lbdreyer/events{/privacy}","received_events_url":"https://api.github.com/users/lbdreyer/received_events","type":"User","site_admin":false},"repo":{"id":61634685,"name":"nc-time-axis","full_name":"lbdreyer/nc-time-axis","owner":{"login":"lbdreyer","id":8101163,"avatar_url":"https://avatars.githubusercontent.com/u/8101163?v=3","gravatar_id":"","url":"https://api.github.com/users/lbdreyer","html_url":"https://github.com/lbdreyer","followers_url":"https://api.github.com/users/lbdreyer/followers","following_url":"https://api.github.com/users/lbdreyer/following{/other_user}","gists_url":"https://api.github.com/users/lbdreyer/gists{/gist_id}","starred_url":"https://api.github.com/users/lbdreyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbdreyer/subscriptions","organizations_url":"https://api.github.com/users/lbdreyer/orgs","repos_url":"https://api.github.com/users/lbdreyer/repos","events_url":"https://api.github.com/users/lbdreyer/events{/privacy}","received_events_url":"https://api.github.com/users/lbdreyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lbdreyer/nc-time-axis","description":"","fork":true,"url":"https://api.github.com/repos/lbdreyer/nc-time-axis","forks_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/forks","keys_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/teams","hooks_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/hooks","issue_events_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/issues/events{/number}","events_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/events","assignees_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/assignees{/user}","branches_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/branches{/branch}","tags_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/tags","blobs_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/git/refs{/sha}","trees_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/statuses/{sha}","languages_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/languages","stargazers_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/stargazers","contributors_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/contributors","subscribers_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/subscribers","subscription_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/subscription","commits_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/commits{/sha}","git_commits_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/git/commits{/sha}","comments_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/comments{/number}","issue_comment_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/issues/comments{/number}","contents_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/contents/{+path}","compare_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/merges","archive_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/downloads","issues_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/issues{/number}","pulls_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/pulls{/number}","milestones_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/milestones{/number}","notifications_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/labels{/name}","releases_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/releases{/id}","deployments_url":"https://api.github.com/repos/lbdreyer/nc-time-axis/deployments","created_at":"2016-06-21T13:09:07Z","updated_at":"2016-06-21T12:50:47Z","pushed_at":"2016-06-29T15:59:55Z","git_url":"git://github.com/lbdreyer/nc-time-axis.git","ssh_url":"git@github.com:lbdreyer/nc-time-axis.git","clone_url":"https://github.com/lbdreyer/nc-time-axis.git","svn_url":"https://github.com/lbdreyer/nc-time-axis","homepage":null,"size":44,"stargazers_count":0,"watchers_count":0,"language":null,"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":"SciTools:master","ref":"master","sha":"b44292ddbbda1f8aa7fe3e6107b45d94520b325f","user":{"login":"SciTools","id":1391487,"avatar_url":"https://avatars.githubusercontent.com/u/1391487?v=3","gravatar_id":"","url":"https://api.github.com/users/SciTools","html_url":"https://github.com/SciTools","followers_url":"https://api.github.com/users/SciTools/followers","following_url":"https://api.github.com/users/SciTools/following{/other_user}","gists_url":"https://api.github.com/users/SciTools/gists{/gist_id}","starred_url":"https://api.github.com/users/SciTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SciTools/subscriptions","organizations_url":"https://api.github.com/users/SciTools/orgs","repos_url":"https://api.github.com/users/SciTools/repos","events_url":"https://api.github.com/users/SciTools/events{/privacy}","received_events_url":"https://api.github.com/users/SciTools/received_events","type":"Organization","site_admin":false},"repo":{"id":61633490,"name":"nc-time-axis","full_name":"SciTools/nc-time-axis","owner":{"login":"SciTools","id":1391487,"avatar_url":"https://avatars.githubusercontent.com/u/1391487?v=3","gravatar_id":"","url":"https://api.github.com/users/SciTools","html_url":"https://github.com/SciTools","followers_url":"https://api.github.com/users/SciTools/followers","following_url":"https://api.github.com/users/SciTools/following{/other_user}","gists_url":"https://api.github.com/users/SciTools/gists{/gist_id}","starred_url":"https://api.github.com/users/SciTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SciTools/subscriptions","organizations_url":"https://api.github.com/users/SciTools/orgs","repos_url":"https://api.github.com/users/SciTools/repos","events_url":"https://api.github.com/users/SciTools/events{/privacy}","received_events_url":"https://api.github.com/users/SciTools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SciTools/nc-time-axis","description":"Support for netcdftime axis in matplotlib.","fork":false,"url":"https://api.github.com/repos/SciTools/nc-time-axis","forks_url":"https://api.github.com/repos/SciTools/nc-time-axis/forks","keys_url":"https://api.github.com/repos/SciTools/nc-time-axis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SciTools/nc-time-axis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SciTools/nc-time-axis/teams","hooks_url":"https://api.github.com/repos/SciTools/nc-time-axis/hooks","issue_events_url":"https://api.github.com/repos/SciTools/nc-time-axis/issues/events{/number}","events_url":"https://api.github.com/repos/SciTools/nc-time-axis/events","assignees_url":"https://api.github.com/repos/SciTools/nc-time-axis/assignees{/user}","branches_url":"https://api.github.com/repos/SciTools/nc-time-axis/branches{/branch}","tags_url":"https://api.github.com/repos/SciTools/nc-time-axis/tags","blobs_url":"https://api.github.com/repos/SciTools/nc-time-axis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SciTools/nc-time-axis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SciTools/nc-time-axis/git/refs{/sha}","trees_url":"https://api.github.com/repos/SciTools/nc-time-axis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SciTools/nc-time-axis/statuses/{sha}","languages_url":"https://api.github.com/repos/SciTools/nc-time-axis/languages","stargazers_url":"https://api.github.com/repos/SciTools/nc-time-axis/stargazers","contributors_url":"https://api.github.com/repos/SciTools/nc-time-axis/contributors","subscribers_url":"https://api.github.com/repos/SciTools/nc-time-axis/subscribers","subscription_url":"https://api.github.com/repos/SciTools/nc-time-axis/subscription","commits_url":"https://api.github.com/repos/SciTools/nc-time-axis/commits{/sha}","git_commits_url":"https://api.github.com/repos/SciTools/nc-time-axis/git/commits{/sha}","comments_url":"https://api.github.com/repos/SciTools/nc-time-axis/comments{/number}","issue_comment_url":"https://api.github.com/repos/SciTools/nc-time-axis/issues/comments{/number}","contents_url":"https://api.github.com/repos/SciTools/nc-time-axis/contents/{+path}","compare_url":"https://api.github.com/repos/SciTools/nc-time-axis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SciTools/nc-time-axis/merges","archive_url":"https://api.github.com/repos/SciTools/nc-time-axis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SciTools/nc-time-axis/downloads","issues_url":"https://api.github.com/repos/SciTools/nc-time-axis/issues{/number}","pulls_url":"https://api.github.com/repos/SciTools/nc-time-axis/pulls{/number}","milestones_url":"https://api.github.com/repos/SciTools/nc-time-axis/milestones{/number}","notifications_url":"https://api.github.com/repos/SciTools/nc-time-axis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SciTools/nc-time-axis/labels{/name}","releases_url":"https://api.github.com/repos/SciTools/nc-time-axis/releases{/id}","deployments_url":"https://api.github.com/repos/SciTools/nc-time-axis/deployments","created_at":"2016-06-21T12:50:47Z","updated_at":"2016-06-22T13:22:30Z","pushed_at":"2016-06-29T16:00:48Z","git_url":"git://github.com/SciTools/nc-time-axis.git","ssh_url":"git@github.com:SciTools/nc-time-axis.git","clone_url":"https://github.com/SciTools/nc-time-axis.git","svn_url":"https://github.com/SciTools/nc-time-axis","homepage":"","size":38,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/12"},"html":{"href":"https://github.com/SciTools/nc-time-axis/pull/12"},"issue":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/issues/12"},"comments":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/SciTools/nc-time-axis/statuses/6df38df83e8497bbd24522a932e442d1dfa1c041"}}}}
{"actor":{"display_login":"lbdreyer"}}