{"action":"created","comment":{"url":"https://api.github.com/repos/wes-turner/dopamine/pulls/comments/258232001","pull_request_review_id":205454786,"id":258232001,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1ODIzMjAwMQ==","diff_hunk":"@@ -0,0 +1,164 @@\n+# coding=utf-8\n+# Copyright 2018 The Dopamine Authors.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\"\"\"Tests for threading_utils.py.\"\"\"\n+from __future__ import absolute_import\n+from __future__ import division\n+from __future__ import print_function\n+\n+import mock\n+import tempfile\n+import threading\n+\n+from dopamine.agents.dqn import dqn_agent\n+from dopamine.utils import threading_utils\n+import tensorflow as tf\n+from tensorflow import test\n+\n+\n+def _get_internal_name(attr):\n+  thread_id = str(threading.current_thread().ident)\n+  return '__' + attr + '_' + thread_id\n+\n+\n+class ThreadsTest(test.TestCase):\n+  \"\"\"Unit tests for threading utils.\"\"\"\n+\n+  def testDefaultValueIsAdded(self):\n+    \"\"\"Tests that the default value is properly set by the helper.\"\"\"\n+    obj = mock.Mock()\n+    threading_utils.initialize_local_attributes(obj, attr=3)\n+    self.assertEqual(obj.attr_default, 3)","path":"tests/dopamine/utils/threading_utils_test.py","position":null,"original_position":42,"commit_id":"4db6ecf4ec08c6acc9e8c7a442d20337192f5979","original_commit_id":"bc1bbe7d418591e75915a05ab141ef64d5725fec","user":{"login":"wes-turner","id":12002965,"node_id":"MDQ6VXNlcjEyMDAyOTY1","avatar_url":"https://avatars1.githubusercontent.com/u/12002965?v=4","gravatar_id":"","url":"https://api.github.com/users/wes-turner","html_url":"https://github.com/wes-turner","followers_url":"https://api.github.com/users/wes-turner/followers","following_url":"https://api.github.com/users/wes-turner/following{/other_user}","gists_url":"https://api.github.com/users/wes-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/wes-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wes-turner/subscriptions","organizations_url":"https://api.github.com/users/wes-turner/orgs","repos_url":"https://api.github.com/users/wes-turner/repos","events_url":"https://api.github.com/users/wes-turner/events{/privacy}","received_events_url":"https://api.github.com/users/wes-turner/received_events","type":"User","site_admin":false},"body":"I don't remember the exact issue here, but I like how the tests look.","created_at":"2019-02-19T21:13:48Z","updated_at":"2019-02-19T21:13:49Z","html_url":"https://github.com/wes-turner/dopamine/pull/4#discussion_r258232001","pull_request_url":"https://api.github.com/repos/wes-turner/dopamine/pulls/4","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/wes-turner/dopamine/pulls/comments/258232001"},"html":{"href":"https://github.com/wes-turner/dopamine/pull/4#discussion_r258232001"},"pull_request":{"href":"https://api.github.com/repos/wes-turner/dopamine/pulls/4"}},"in_reply_to_id":255272857},"pull_request":{"url":"https://api.github.com/repos/wes-turner/dopamine/pulls/4","id":250885019,"node_id":"MDExOlB1bGxSZXF1ZXN0MjUwODg1MDE5","html_url":"https://github.com/wes-turner/dopamine/pull/4","diff_url":"https://github.com/wes-turner/dopamine/pull/4.diff","patch_url":"https://github.com/wes-turner/dopamine/pull/4.patch","issue_url":"https://api.github.com/repos/wes-turner/dopamine/issues/4","number":4,"state":"open","locked":false,"title":"Adapt agent to asynchronous training.","user":{"login":"arthurarg","id":8765360,"node_id":"MDQ6VXNlcjg3NjUzNjA=","avatar_url":"https://avatars1.githubusercontent.com/u/8765360?v=4","gravatar_id":"","url":"https://api.github.com/users/arthurarg","html_url":"https://github.com/arthurarg","followers_url":"https://api.github.com/users/arthurarg/followers","following_url":"https://api.github.com/users/arthurarg/following{/other_user}","gists_url":"https://api.github.com/users/arthurarg/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurarg/subscriptions","organizations_url":"https://api.github.com/users/arthurarg/orgs","repos_url":"https://api.github.com/users/arthurarg/repos","events_url":"https://api.github.com/users/arthurarg/events{/privacy}","received_events_url":"https://api.github.com/users/arthurarg/received_events","type":"User","site_admin":false},"body":"Duplicates some of the agent's attribute so that they are specific to the local thread.\r\n\r\nThese attributes are related to the ongoing experience generation (e.g. last observation and last state).","created_at":"2019-02-06T19:50:19Z","updated_at":"2019-02-19T21:13:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"680963c699319d406c420c6ce5b4680a13be12c2","assignee":{"login":"wes-turner","id":12002965,"node_id":"MDQ6VXNlcjEyMDAyOTY1","avatar_url":"https://avatars1.githubusercontent.com/u/12002965?v=4","gravatar_id":"","url":"https://api.github.com/users/wes-turner","html_url":"https://github.com/wes-turner","followers_url":"https://api.github.com/users/wes-turner/followers","following_url":"https://api.github.com/users/wes-turner/following{/other_user}","gists_url":"https://api.github.com/users/wes-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/wes-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wes-turner/subscriptions","organizations_url":"https://api.github.com/users/wes-turner/orgs","repos_url":"https://api.github.com/users/wes-turner/repos","events_url":"https://api.github.com/users/wes-turner/events{/privacy}","received_events_url":"https://api.github.com/users/wes-turner/received_events","type":"User","site_admin":false},"assignees":[{"login":"wes-turner","id":12002965,"node_id":"MDQ6VXNlcjEyMDAyOTY1","avatar_url":"https://avatars1.githubusercontent.com/u/12002965?v=4","gravatar_id":"","url":"https://api.github.com/users/wes-turner","html_url":"https://github.com/wes-turner","followers_url":"https://api.github.com/users/wes-turner/followers","following_url":"https://api.github.com/users/wes-turner/following{/other_user}","gists_url":"https://api.github.com/users/wes-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/wes-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wes-turner/subscriptions","organizations_url":"https://api.github.com/users/wes-turner/orgs","repos_url":"https://api.github.com/users/wes-turner/repos","events_url":"https://api.github.com/users/wes-turner/events{/privacy}","received_events_url":"https://api.github.com/users/wes-turner/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wes-turner/dopamine/pulls/4/commits","review_comments_url":"https://api.github.com/repos/wes-turner/dopamine/pulls/4/comments","review_comment_url":"https://api.github.com/repos/wes-turner/dopamine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wes-turner/dopamine/issues/4/comments","statuses_url":"https://api.github.com/repos/wes-turner/dopamine/statuses/4db6ecf4ec08c6acc9e8c7a442d20337192f5979","head":{"label":"wes-turner:adapt_agent_to_async","ref":"adapt_agent_to_async","sha":"4db6ecf4ec08c6acc9e8c7a442d20337192f5979","user":{"login":"wes-turner","id":12002965,"node_id":"MDQ6VXNlcjEyMDAyOTY1","avatar_url":"https://avatars1.githubusercontent.com/u/12002965?v=4","gravatar_id":"","url":"https://api.github.com/users/wes-turner","html_url":"https://github.com/wes-turner","followers_url":"https://api.github.com/users/wes-turner/followers","following_url":"https://api.github.com/users/wes-turner/following{/other_user}","gists_url":"https://api.github.com/users/wes-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/wes-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wes-turner/subscriptions","organizations_url":"https://api.github.com/users/wes-turner/orgs","repos_url":"https://api.github.com/users/wes-turner/repos","events_url":"https://api.github.com/users/wes-turner/events{/privacy}","received_events_url":"https://api.github.com/users/wes-turner/received_events","type":"User","site_admin":false},"repo":{"id":168429275,"node_id":"MDEwOlJlcG9zaXRvcnkxNjg0MjkyNzU=","name":"dopamine","full_name":"wes-turner/dopamine","private":false,"owner":{"login":"wes-turner","id":12002965,"node_id":"MDQ6VXNlcjEyMDAyOTY1","avatar_url":"https://avatars1.githubusercontent.com/u/12002965?v=4","gravatar_id":"","url":"https://api.github.com/users/wes-turner","html_url":"https://github.com/wes-turner","followers_url":"https://api.github.com/users/wes-turner/followers","following_url":"https://api.github.com/users/wes-turner/following{/other_user}","gists_url":"https://api.github.com/users/wes-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/wes-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wes-turner/subscriptions","organizations_url":"https://api.github.com/users/wes-turner/orgs","repos_url":"https://api.github.com/users/wes-turner/repos","events_url":"https://api.github.com/users/wes-turner/events{/privacy}","received_events_url":"https://api.github.com/users/wes-turner/received_events","type":"User","site_admin":false},"html_url":"https://github.com/wes-turner/dopamine","description":"Dopamine is a research framework for fast prototyping of reinforcement learning algorithms. ","fork":true,"url":"https://api.github.com/repos/wes-turner/dopamine","forks_url":"https://api.github.com/repos/wes-turner/dopamine/forks","keys_url":"https://api.github.com/repos/wes-turner/dopamine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wes-turner/dopamine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wes-turner/dopamine/teams","hooks_url":"https://api.github.com/repos/wes-turner/dopamine/hooks","issue_events_url":"https://api.github.com/repos/wes-turner/dopamine/issues/events{/number}","events_url":"https://api.github.com/repos/wes-turner/dopamine/events","assignees_url":"https://api.github.com/repos/wes-turner/dopamine/assignees{/user}","branches_url":"https://api.github.com/repos/wes-turner/dopamine/branches{/branch}","tags_url":"https://api.github.com/repos/wes-turner/dopamine/tags","blobs_url":"https://api.github.com/repos/wes-turner/dopamine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wes-turner/dopamine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wes-turner/dopamine/git/refs{/sha}","trees_url":"https://api.github.com/repos/wes-turner/dopamine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wes-turner/dopamine/statuses/{sha}","languages_url":"https://api.github.com/repos/wes-turner/dopamine/languages","stargazers_url":"https://api.github.com/repos/wes-turner/dopamine/stargazers","contributors_url":"https://api.github.com/repos/wes-turner/dopamine/contributors","subscribers_url":"https://api.github.com/repos/wes-turner/dopamine/subscribers","subscription_url":"https://api.github.com/repos/wes-turner/dopamine/subscription","commits_url":"https://api.github.com/repos/wes-turner/dopamine/commits{/sha}","git_commits_url":"https://api.github.com/repos/wes-turner/dopamine/git/commits{/sha}","comments_url":"https://api.github.com/repos/wes-turner/dopamine/comments{/number}","issue_comment_url":"https://api.github.com/repos/wes-turner/dopamine/issues/comments{/number}","contents_url":"https://api.github.com/repos/wes-turner/dopamine/contents/{+path}","compare_url":"https://api.github.com/repos/wes-turner/dopamine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wes-turner/dopamine/merges","archive_url":"https://api.github.com/repos/wes-turner/dopamine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wes-turner/dopamine/downloads","issues_url":"https://api.github.com/repos/wes-turner/dopamine/issues{/number}","pulls_url":"https://api.github.com/repos/wes-turner/dopamine/pulls{/number}","milestones_url":"https://api.github.com/repos/wes-turner/dopamine/milestones{/number}","notifications_url":"https://api.github.com/repos/wes-turner/dopamine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wes-turner/dopamine/labels{/name}","releases_url":"https://api.github.com/repos/wes-turner/dopamine/releases{/id}","deployments_url":"https://api.github.com/repos/wes-turner/dopamine/deployments","created_at":"2019-01-30T23:06:06Z","updated_at":"2019-02-04T22:15:11Z","pushed_at":"2019-02-18T15:43:11Z","git_url":"git://github.com/wes-turner/dopamine.git","ssh_url":"git@github.com:wes-turner/dopamine.git","clone_url":"https://github.com/wes-turner/dopamine.git","svn_url":"https://github.com/wes-turner/dopamine","homepage":"https://github.com/google/dopamine","size":6953,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"wes-turner:master","ref":"master","sha":"34ac3ea4ad925fc17bb8c5257f0973cfb0e1d319","user":{"login":"wes-turner","id":12002965,"node_id":"MDQ6VXNlcjEyMDAyOTY1","avatar_url":"https://avatars1.githubusercontent.com/u/12002965?v=4","gravatar_id":"","url":"https://api.github.com/users/wes-turner","html_url":"https://github.com/wes-turner","followers_url":"https://api.github.com/users/wes-turner/followers","following_url":"https://api.github.com/users/wes-turner/following{/other_user}","gists_url":"https://api.github.com/users/wes-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/wes-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wes-turner/subscriptions","organizations_url":"https://api.github.com/users/wes-turner/orgs","repos_url":"https://api.github.com/users/wes-turner/repos","events_url":"https://api.github.com/users/wes-turner/events{/privacy}","received_events_url":"https://api.github.com/users/wes-turner/received_events","type":"User","site_admin":false},"repo":{"id":168429275,"node_id":"MDEwOlJlcG9zaXRvcnkxNjg0MjkyNzU=","name":"dopamine","full_name":"wes-turner/dopamine","private":false,"owner":{"login":"wes-turner","id":12002965,"node_id":"MDQ6VXNlcjEyMDAyOTY1","avatar_url":"https://avatars1.githubusercontent.com/u/12002965?v=4","gravatar_id":"","url":"https://api.github.com/users/wes-turner","html_url":"https://github.com/wes-turner","followers_url":"https://api.github.com/users/wes-turner/followers","following_url":"https://api.github.com/users/wes-turner/following{/other_user}","gists_url":"https://api.github.com/users/wes-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/wes-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wes-turner/subscriptions","organizations_url":"https://api.github.com/users/wes-turner/orgs","repos_url":"https://api.github.com/users/wes-turner/repos","events_url":"https://api.github.com/users/wes-turner/events{/privacy}","received_events_url":"https://api.github.com/users/wes-turner/received_events","type":"User","site_admin":false},"html_url":"https://github.com/wes-turner/dopamine","description":"Dopamine is a research framework for fast prototyping of reinforcement learning algorithms. ","fork":true,"url":"https://api.github.com/repos/wes-turner/dopamine","forks_url":"https://api.github.com/repos/wes-turner/dopamine/forks","keys_url":"https://api.github.com/repos/wes-turner/dopamine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wes-turner/dopamine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wes-turner/dopamine/teams","hooks_url":"https://api.github.com/repos/wes-turner/dopamine/hooks","issue_events_url":"https://api.github.com/repos/wes-turner/dopamine/issues/events{/number}","events_url":"https://api.github.com/repos/wes-turner/dopamine/events","assignees_url":"https://api.github.com/repos/wes-turner/dopamine/assignees{/user}","branches_url":"https://api.github.com/repos/wes-turner/dopamine/branches{/branch}","tags_url":"https://api.github.com/repos/wes-turner/dopamine/tags","blobs_url":"https://api.github.com/repos/wes-turner/dopamine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wes-turner/dopamine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wes-turner/dopamine/git/refs{/sha}","trees_url":"https://api.github.com/repos/wes-turner/dopamine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wes-turner/dopamine/statuses/{sha}","languages_url":"https://api.github.com/repos/wes-turner/dopamine/languages","stargazers_url":"https://api.github.com/repos/wes-turner/dopamine/stargazers","contributors_url":"https://api.github.com/repos/wes-turner/dopamine/contributors","subscribers_url":"https://api.github.com/repos/wes-turner/dopamine/subscribers","subscription_url":"https://api.github.com/repos/wes-turner/dopamine/subscription","commits_url":"https://api.github.com/repos/wes-turner/dopamine/commits{/sha}","git_commits_url":"https://api.github.com/repos/wes-turner/dopamine/git/commits{/sha}","comments_url":"https://api.github.com/repos/wes-turner/dopamine/comments{/number}","issue_comment_url":"https://api.github.com/repos/wes-turner/dopamine/issues/comments{/number}","contents_url":"https://api.github.com/repos/wes-turner/dopamine/contents/{+path}","compare_url":"https://api.github.com/repos/wes-turner/dopamine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wes-turner/dopamine/merges","archive_url":"https://api.github.com/repos/wes-turner/dopamine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wes-turner/dopamine/downloads","issues_url":"https://api.github.com/repos/wes-turner/dopamine/issues{/number}","pulls_url":"https://api.github.com/repos/wes-turner/dopamine/pulls{/number}","milestones_url":"https://api.github.com/repos/wes-turner/dopamine/milestones{/number}","notifications_url":"https://api.github.com/repos/wes-turner/dopamine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wes-turner/dopamine/labels{/name}","releases_url":"https://api.github.com/repos/wes-turner/dopamine/releases{/id}","deployments_url":"https://api.github.com/repos/wes-turner/dopamine/deployments","created_at":"2019-01-30T23:06:06Z","updated_at":"2019-02-04T22:15:11Z","pushed_at":"2019-02-18T15:43:11Z","git_url":"git://github.com/wes-turner/dopamine.git","ssh_url":"git@github.com:wes-turner/dopamine.git","clone_url":"https://github.com/wes-turner/dopamine.git","svn_url":"https://github.com/wes-turner/dopamine","homepage":"https://github.com/google/dopamine","size":6953,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wes-turner/dopamine/pulls/4"},"html":{"href":"https://github.com/wes-turner/dopamine/pull/4"},"issue":{"href":"https://api.github.com/repos/wes-turner/dopamine/issues/4"},"comments":{"href":"https://api.github.com/repos/wes-turner/dopamine/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/wes-turner/dopamine/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/wes-turner/dopamine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wes-turner/dopamine/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/wes-turner/dopamine/statuses/4db6ecf4ec08c6acc9e8c7a442d20337192f5979"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"wes-turner"}}