{"action":"created","comment":{"url":"https://api.github.com/repos/joblib/joblib/pulls/comments/81455477","pull_request_review_id":2436413,"id":81455477,"diff_hunk":"@@ -470,6 +470,35 @@ def __init__(self, func, cachedir, ignore=None, mmap_mode=None,\n             doc = func.__doc__\n         self.__doc__ = 'Memoized version of %s' % doc\n \n+    def is_cached(self, *args, **kwargs):\n+        \"\"\"Check to see if a call to the wrapped function with these arguments\n+        would result in a cache hit.\n+\n+        Returns\n+        -------\n+        cached: bool\n+            Whether or not the call is already cached\n+        \"\"\"\n+        output_dir, argument_hash = self._get_output_dir(*args, **kwargs)\n+        return self._needs_call(output_dir, argument_hash)\n+\n+    def _needs_call(self, output_dir, argument_hash):","path":"joblib/memory.py","position":null,"original_position":16,"commit_id":"e74f560858d0d1cb3f7aec758b1f5f81d99f644d","original_commit_id":"0d0cbfbceeb8564711b342a7cfc73500f362c5c7","user":{"login":"alec-deason","id":419770,"avatar_url":"https://avatars.githubusercontent.com/u/419770?v=3","gravatar_id":"","url":"https://api.github.com/users/alec-deason","html_url":"https://github.com/alec-deason","followers_url":"https://api.github.com/users/alec-deason/followers","following_url":"https://api.github.com/users/alec-deason/following{/other_user}","gists_url":"https://api.github.com/users/alec-deason/gists{/gist_id}","starred_url":"https://api.github.com/users/alec-deason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alec-deason/subscriptions","organizations_url":"https://api.github.com/users/alec-deason/orgs","repos_url":"https://api.github.com/users/alec-deason/repos","events_url":"https://api.github.com/users/alec-deason/events{/privacy}","received_events_url":"https://api.github.com/users/alec-deason/received_events","type":"User","site_admin":false},"body":"Yep, totally.","created_at":"2016-10-01T18:24:51Z","updated_at":"2016-10-01T18:24:51Z","html_url":"https://github.com/joblib/joblib/pull/407#discussion_r81455477","pull_request_url":"https://api.github.com/repos/joblib/joblib/pulls/407","_links":{"self":{"href":"https://api.github.com/repos/joblib/joblib/pulls/comments/81455477"},"html":{"href":"https://github.com/joblib/joblib/pull/407#discussion_r81455477"},"pull_request":{"href":"https://api.github.com/repos/joblib/joblib/pulls/407"}}},"pull_request":{"url":"https://api.github.com/repos/joblib/joblib/pulls/407","id":87547649,"html_url":"https://github.com/joblib/joblib/pull/407","diff_url":"https://github.com/joblib/joblib/pull/407.diff","patch_url":"https://github.com/joblib/joblib/pull/407.patch","issue_url":"https://api.github.com/repos/joblib/joblib/issues/407","number":407,"state":"open","locked":false,"title":"Add a public is_cached method","user":{"login":"alec-deason","id":419770,"avatar_url":"https://avatars.githubusercontent.com/u/419770?v=3","gravatar_id":"","url":"https://api.github.com/users/alec-deason","html_url":"https://github.com/alec-deason","followers_url":"https://api.github.com/users/alec-deason/followers","following_url":"https://api.github.com/users/alec-deason/following{/other_user}","gists_url":"https://api.github.com/users/alec-deason/gists{/gist_id}","starred_url":"https://api.github.com/users/alec-deason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alec-deason/subscriptions","organizations_url":"https://api.github.com/users/alec-deason/orgs","repos_url":"https://api.github.com/users/alec-deason/repos","events_url":"https://api.github.com/users/alec-deason/events{/privacy}","received_events_url":"https://api.github.com/users/alec-deason/received_events","type":"User","site_admin":false},"body":"Make it so that client code can check if a call to a wrapped function will require the recomputation or if it can be loaded from disk.\r\n\r\nMy use case for this is allow a distributed system to more intelligently manage locks around the calculation of cache objects.","created_at":"2016-09-30T18:57:58Z","updated_at":"2016-10-01T18:24:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba11fdfb61e86013a9ddc45eed9955b437e3fcab","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/joblib/joblib/pulls/407/commits","review_comments_url":"https://api.github.com/repos/joblib/joblib/pulls/407/comments","review_comment_url":"https://api.github.com/repos/joblib/joblib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joblib/joblib/issues/407/comments","statuses_url":"https://api.github.com/repos/joblib/joblib/statuses/e74f560858d0d1cb3f7aec758b1f5f81d99f644d","head":{"label":"alec-deason:master","ref":"master","sha":"e74f560858d0d1cb3f7aec758b1f5f81d99f644d","user":{"login":"alec-deason","id":419770,"avatar_url":"https://avatars.githubusercontent.com/u/419770?v=3","gravatar_id":"","url":"https://api.github.com/users/alec-deason","html_url":"https://github.com/alec-deason","followers_url":"https://api.github.com/users/alec-deason/followers","following_url":"https://api.github.com/users/alec-deason/following{/other_user}","gists_url":"https://api.github.com/users/alec-deason/gists{/gist_id}","starred_url":"https://api.github.com/users/alec-deason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alec-deason/subscriptions","organizations_url":"https://api.github.com/users/alec-deason/orgs","repos_url":"https://api.github.com/users/alec-deason/repos","events_url":"https://api.github.com/users/alec-deason/events{/privacy}","received_events_url":"https://api.github.com/users/alec-deason/received_events","type":"User","site_admin":false},"repo":{"id":69692576,"name":"joblib","full_name":"alec-deason/joblib","owner":{"login":"alec-deason","id":419770,"avatar_url":"https://avatars.githubusercontent.com/u/419770?v=3","gravatar_id":"","url":"https://api.github.com/users/alec-deason","html_url":"https://github.com/alec-deason","followers_url":"https://api.github.com/users/alec-deason/followers","following_url":"https://api.github.com/users/alec-deason/following{/other_user}","gists_url":"https://api.github.com/users/alec-deason/gists{/gist_id}","starred_url":"https://api.github.com/users/alec-deason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alec-deason/subscriptions","organizations_url":"https://api.github.com/users/alec-deason/orgs","repos_url":"https://api.github.com/users/alec-deason/repos","events_url":"https://api.github.com/users/alec-deason/events{/privacy}","received_events_url":"https://api.github.com/users/alec-deason/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alec-deason/joblib","description":"Python function as pipeline jobs.","fork":true,"url":"https://api.github.com/repos/alec-deason/joblib","forks_url":"https://api.github.com/repos/alec-deason/joblib/forks","keys_url":"https://api.github.com/repos/alec-deason/joblib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alec-deason/joblib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alec-deason/joblib/teams","hooks_url":"https://api.github.com/repos/alec-deason/joblib/hooks","issue_events_url":"https://api.github.com/repos/alec-deason/joblib/issues/events{/number}","events_url":"https://api.github.com/repos/alec-deason/joblib/events","assignees_url":"https://api.github.com/repos/alec-deason/joblib/assignees{/user}","branches_url":"https://api.github.com/repos/alec-deason/joblib/branches{/branch}","tags_url":"https://api.github.com/repos/alec-deason/joblib/tags","blobs_url":"https://api.github.com/repos/alec-deason/joblib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alec-deason/joblib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alec-deason/joblib/git/refs{/sha}","trees_url":"https://api.github.com/repos/alec-deason/joblib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alec-deason/joblib/statuses/{sha}","languages_url":"https://api.github.com/repos/alec-deason/joblib/languages","stargazers_url":"https://api.github.com/repos/alec-deason/joblib/stargazers","contributors_url":"https://api.github.com/repos/alec-deason/joblib/contributors","subscribers_url":"https://api.github.com/repos/alec-deason/joblib/subscribers","subscription_url":"https://api.github.com/repos/alec-deason/joblib/subscription","commits_url":"https://api.github.com/repos/alec-deason/joblib/commits{/sha}","git_commits_url":"https://api.github.com/repos/alec-deason/joblib/git/commits{/sha}","comments_url":"https://api.github.com/repos/alec-deason/joblib/comments{/number}","issue_comment_url":"https://api.github.com/repos/alec-deason/joblib/issues/comments{/number}","contents_url":"https://api.github.com/repos/alec-deason/joblib/contents/{+path}","compare_url":"https://api.github.com/repos/alec-deason/joblib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alec-deason/joblib/merges","archive_url":"https://api.github.com/repos/alec-deason/joblib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alec-deason/joblib/downloads","issues_url":"https://api.github.com/repos/alec-deason/joblib/issues{/number}","pulls_url":"https://api.github.com/repos/alec-deason/joblib/pulls{/number}","milestones_url":"https://api.github.com/repos/alec-deason/joblib/milestones{/number}","notifications_url":"https://api.github.com/repos/alec-deason/joblib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alec-deason/joblib/labels{/name}","releases_url":"https://api.github.com/repos/alec-deason/joblib/releases{/id}","deployments_url":"https://api.github.com/repos/alec-deason/joblib/deployments","created_at":"2016-09-30T18:42:22Z","updated_at":"2016-09-30T18:42:23Z","pushed_at":"2016-10-01T18:23:58Z","git_url":"git://github.com/alec-deason/joblib.git","ssh_url":"git@github.com:alec-deason/joblib.git","clone_url":"https://github.com/alec-deason/joblib.git","svn_url":"https://github.com/alec-deason/joblib","homepage":"http://packages.python.org/joblib/","size":2477,"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":"joblib:master","ref":"master","sha":"3b9464f662ad663828a41443eeb22c5408979793","user":{"login":"joblib","id":332661,"avatar_url":"https://avatars.githubusercontent.com/u/332661?v=3","gravatar_id":"","url":"https://api.github.com/users/joblib","html_url":"https://github.com/joblib","followers_url":"https://api.github.com/users/joblib/followers","following_url":"https://api.github.com/users/joblib/following{/other_user}","gists_url":"https://api.github.com/users/joblib/gists{/gist_id}","starred_url":"https://api.github.com/users/joblib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joblib/subscriptions","organizations_url":"https://api.github.com/users/joblib/orgs","repos_url":"https://api.github.com/users/joblib/repos","events_url":"https://api.github.com/users/joblib/events{/privacy}","received_events_url":"https://api.github.com/users/joblib/received_events","type":"Organization","site_admin":false},"repo":{"id":654608,"name":"joblib","full_name":"joblib/joblib","owner":{"login":"joblib","id":332661,"avatar_url":"https://avatars.githubusercontent.com/u/332661?v=3","gravatar_id":"","url":"https://api.github.com/users/joblib","html_url":"https://github.com/joblib","followers_url":"https://api.github.com/users/joblib/followers","following_url":"https://api.github.com/users/joblib/following{/other_user}","gists_url":"https://api.github.com/users/joblib/gists{/gist_id}","starred_url":"https://api.github.com/users/joblib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joblib/subscriptions","organizations_url":"https://api.github.com/users/joblib/orgs","repos_url":"https://api.github.com/users/joblib/repos","events_url":"https://api.github.com/users/joblib/events{/privacy}","received_events_url":"https://api.github.com/users/joblib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joblib/joblib","description":"Python function as pipeline jobs.","fork":false,"url":"https://api.github.com/repos/joblib/joblib","forks_url":"https://api.github.com/repos/joblib/joblib/forks","keys_url":"https://api.github.com/repos/joblib/joblib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joblib/joblib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joblib/joblib/teams","hooks_url":"https://api.github.com/repos/joblib/joblib/hooks","issue_events_url":"https://api.github.com/repos/joblib/joblib/issues/events{/number}","events_url":"https://api.github.com/repos/joblib/joblib/events","assignees_url":"https://api.github.com/repos/joblib/joblib/assignees{/user}","branches_url":"https://api.github.com/repos/joblib/joblib/branches{/branch}","tags_url":"https://api.github.com/repos/joblib/joblib/tags","blobs_url":"https://api.github.com/repos/joblib/joblib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joblib/joblib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joblib/joblib/git/refs{/sha}","trees_url":"https://api.github.com/repos/joblib/joblib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joblib/joblib/statuses/{sha}","languages_url":"https://api.github.com/repos/joblib/joblib/languages","stargazers_url":"https://api.github.com/repos/joblib/joblib/stargazers","contributors_url":"https://api.github.com/repos/joblib/joblib/contributors","subscribers_url":"https://api.github.com/repos/joblib/joblib/subscribers","subscription_url":"https://api.github.com/repos/joblib/joblib/subscription","commits_url":"https://api.github.com/repos/joblib/joblib/commits{/sha}","git_commits_url":"https://api.github.com/repos/joblib/joblib/git/commits{/sha}","comments_url":"https://api.github.com/repos/joblib/joblib/comments{/number}","issue_comment_url":"https://api.github.com/repos/joblib/joblib/issues/comments{/number}","contents_url":"https://api.github.com/repos/joblib/joblib/contents/{+path}","compare_url":"https://api.github.com/repos/joblib/joblib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joblib/joblib/merges","archive_url":"https://api.github.com/repos/joblib/joblib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joblib/joblib/downloads","issues_url":"https://api.github.com/repos/joblib/joblib/issues{/number}","pulls_url":"https://api.github.com/repos/joblib/joblib/pulls{/number}","milestones_url":"https://api.github.com/repos/joblib/joblib/milestones{/number}","notifications_url":"https://api.github.com/repos/joblib/joblib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joblib/joblib/labels{/name}","releases_url":"https://api.github.com/repos/joblib/joblib/releases{/id}","deployments_url":"https://api.github.com/repos/joblib/joblib/deployments","created_at":"2010-05-07T06:48:26Z","updated_at":"2016-09-30T11:51:08Z","pushed_at":"2016-10-01T18:23:59Z","git_url":"git://github.com/joblib/joblib.git","ssh_url":"git@github.com:joblib/joblib.git","clone_url":"https://github.com/joblib/joblib.git","svn_url":"https://github.com/joblib/joblib","homepage":"http://packages.python.org/joblib/","size":3410,"stargazers_count":766,"watchers_count":766,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":121,"mirror_url":null,"open_issues_count":105,"forks":121,"open_issues":105,"watchers":766,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/joblib/joblib/pulls/407"},"html":{"href":"https://github.com/joblib/joblib/pull/407"},"issue":{"href":"https://api.github.com/repos/joblib/joblib/issues/407"},"comments":{"href":"https://api.github.com/repos/joblib/joblib/issues/407/comments"},"review_comments":{"href":"https://api.github.com/repos/joblib/joblib/pulls/407/comments"},"review_comment":{"href":"https://api.github.com/repos/joblib/joblib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joblib/joblib/pulls/407/commits"},"statuses":{"href":"https://api.github.com/repos/joblib/joblib/statuses/e74f560858d0d1cb3f7aec758b1f5f81d99f644d"}}}}
{"actor":{"display_login":"alec-deason"}}