{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/48635532","id":48635532,"diff_hunk":"@@ -437,6 +438,9 @@ def precision(self, val):\n             raise ValueError('precision attribute must be an int between '\n                              '0 and 9')\n         self._precision = val\n+        if hasattr(self, '_time'):","path":"astropy/time/core.py","position":12,"original_position":12,"commit_id":"f54382d87a80539d1436ee50eac9166d0609a632","original_commit_id":"b3da85288c3c217d0bd853d1e6abfee769c397b5","user":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"body":"p.s. Independently, yes, the cache should be deleted -- unless we can somehow use in-place changes such that all `_precision` attributes always refers to the same object (but probably too much risk of foot-shooting).","created_at":"2015-12-30T22:14:34Z","updated_at":"2015-12-30T22:14:34Z","html_url":"https://github.com/astropy/astropy/pull/4422#discussion_r48635532","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/4422","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/48635532"},"html":{"href":"https://github.com/astropy/astropy/pull/4422#discussion_r48635532"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/4422"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/4422","id":54747743,"html_url":"https://github.com/astropy/astropy/pull/4422","diff_url":"https://github.com/astropy/astropy/pull/4422.diff","patch_url":"https://github.com/astropy/astropy/pull/4422.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/4422","number":4422,"state":"open","locked":false,"title":"Implement caching for Time scale and format","user":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"body":"This implements caching to resolve #4309.  The footprint got a little bigger than I had hoped, in part because I expanded the scope to include format caching as well.  Because if this I want to get some review before going ahead with doc updates.  \r\n\r\nThe changes in `__add__` and `__sub__` highlight the subtle problems that can come along with caching.  Basically you need to be careful when messing around with `_time` internals.\r\n\r\nParts of the precision testing were taken out because they relied on changing the internal time object state in a way that is not allowed in normal use.\r\n","created_at":"2015-12-29T18:33:24Z","updated_at":"2015-12-30T22:14:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"441e0844127e3faffaa0c6ac7acdcbf0498671b3","assignee":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/26","html_url":"https://github.com/astropy/astropy/milestones/v1.2.0","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/26/labels","id":1114049,"number":26,"title":"v1.2.0","description":"","creator":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":5,"state":"open","created_at":"2015-05-17T16:11:47Z","updated_at":"2015-12-30T01:49:41Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/4422/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/4422/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/4422/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/f54382d87a80539d1436ee50eac9166d0609a632","head":{"label":"taldcroft:time-cache","ref":"time-cache","sha":"f54382d87a80539d1436ee50eac9166d0609a632","user":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"repo":{"id":2571537,"name":"astropy","full_name":"taldcroft/astropy","owner":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/taldcroft/astropy","description":"Main AstroPy repository","fork":true,"url":"https://api.github.com/repos/taldcroft/astropy","forks_url":"https://api.github.com/repos/taldcroft/astropy/forks","keys_url":"https://api.github.com/repos/taldcroft/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taldcroft/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taldcroft/astropy/teams","hooks_url":"https://api.github.com/repos/taldcroft/astropy/hooks","issue_events_url":"https://api.github.com/repos/taldcroft/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/taldcroft/astropy/events","assignees_url":"https://api.github.com/repos/taldcroft/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/taldcroft/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/taldcroft/astropy/tags","blobs_url":"https://api.github.com/repos/taldcroft/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taldcroft/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taldcroft/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/taldcroft/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taldcroft/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/taldcroft/astropy/languages","stargazers_url":"https://api.github.com/repos/taldcroft/astropy/stargazers","contributors_url":"https://api.github.com/repos/taldcroft/astropy/contributors","subscribers_url":"https://api.github.com/repos/taldcroft/astropy/subscribers","subscription_url":"https://api.github.com/repos/taldcroft/astropy/subscription","commits_url":"https://api.github.com/repos/taldcroft/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/taldcroft/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/taldcroft/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/taldcroft/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/taldcroft/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/taldcroft/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taldcroft/astropy/merges","archive_url":"https://api.github.com/repos/taldcroft/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taldcroft/astropy/downloads","issues_url":"https://api.github.com/repos/taldcroft/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/taldcroft/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/taldcroft/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/taldcroft/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taldcroft/astropy/labels{/name}","releases_url":"https://api.github.com/repos/taldcroft/astropy/releases{/id}","created_at":"2011-10-13T18:44:28Z","updated_at":"2015-01-27T03:15:49Z","pushed_at":"2015-12-30T20:00:55Z","git_url":"git://github.com/taldcroft/astropy.git","ssh_url":"git@github.com:taldcroft/astropy.git","clone_url":"https://github.com/taldcroft/astropy.git","svn_url":"https://github.com/taldcroft/astropy","homepage":"astropy.org","size":40801,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"4bc6ada84e9706ce95109127366c229d3ee5b995","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2081289,"name":"astropy","full_name":"astropy/astropy","owner":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/astropy/astropy","description":"Repository for the Astropy core package","fork":false,"url":"https://api.github.com/repos/astropy/astropy","forks_url":"https://api.github.com/repos/astropy/astropy/forks","keys_url":"https://api.github.com/repos/astropy/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/astropy/teams","hooks_url":"https://api.github.com/repos/astropy/astropy/hooks","issue_events_url":"https://api.github.com/repos/astropy/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/astropy/events","assignees_url":"https://api.github.com/repos/astropy/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/astropy/tags","blobs_url":"https://api.github.com/repos/astropy/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/astropy/languages","stargazers_url":"https://api.github.com/repos/astropy/astropy/stargazers","contributors_url":"https://api.github.com/repos/astropy/astropy/contributors","subscribers_url":"https://api.github.com/repos/astropy/astropy/subscribers","subscription_url":"https://api.github.com/repos/astropy/astropy/subscription","commits_url":"https://api.github.com/repos/astropy/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/astropy/merges","archive_url":"https://api.github.com/repos/astropy/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/astropy/downloads","issues_url":"https://api.github.com/repos/astropy/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astropy/astropy/releases{/id}","created_at":"2011-07-21T01:33:49Z","updated_at":"2015-12-29T11:51:21Z","pushed_at":"2015-12-30T20:00:55Z","git_url":"git://github.com/astropy/astropy.git","ssh_url":"git@github.com:astropy/astropy.git","clone_url":"https://github.com/astropy/astropy.git","svn_url":"https://github.com/astropy/astropy","homepage":"www.astropy.org","size":58638,"stargazers_count":756,"watchers_count":756,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":475,"mirror_url":null,"open_issues_count":634,"forks":475,"open_issues":634,"watchers":756,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/4422"},"html":{"href":"https://github.com/astropy/astropy/pull/4422"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/4422"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/4422/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/4422/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/4422/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/f54382d87a80539d1436ee50eac9166d0609a632"}}}}