{"action":"created","comment":{"url":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/comments/110485874","pull_request_review_id":31667602,"id":110485874,"diff_hunk":"@@ -0,0 +1,58 @@\n+#include \"pytorchcraft.h\"\n+\n+#include \"state.h\"\n+\n+using namespace torchcraft;\n+\n+void init_state(py::module& torchcraft) {\n+  py::class_<State> state(torchcraft, \"State\");\n+  py::class_<State::Position>(state, \"Position\")\n+      .def(py::init<>())\n+      .def(py::init<int, int>())\n+      .def_readwrite(\"x\", &State::Position::x)\n+      .def_readwrite(\"y\", &State::Position::y);\n+\n+  state.def_readwrite(\"lag_frames\", &State::lag_frames)\n+      .def_property_readonly(\n+          \"map_size\",\n+          [](State* self) {\n+            return py::make_tuple(self->map_size[0], self->map_size[1]);\n+          })\n+      .def_readwrite(\"ground_height_data\", &State::ground_height_data)\n+      .def_readwrite(\"walkable_data\", &State::walkable_data)\n+      .def_readwrite(\"buildable_data\", &State::buildable_data)\n+      .def_readwrite(\"map_name\", &State::map_name)\n+      .def_readwrite(\"start_locations\", &State::start_locations)\n+      .def_readwrite(\"player_id\", &State::player_id)\n+      .def_readwrite(\"neutral_id\", &State::neutral_id)\n+      .def_readwrite(\"replay\", &State::replay)\n+      .def_readwrite(\"frame_string\", &State::frame_string)\n+      .def_readwrite(\"deaths\", &State::deaths)\n+      .def_readwrite(\"frame_from_bwapi\", &State::frame_from_bwapi)\n+      .def_readwrite(\"battle_frame_count\", &State::battle_frame_count)\n+      .def_readwrite(\"game_ended\", &State::game_ended)\n+      .def_readwrite(\"game_won\", &State::game_won)\n+      .def_readwrite(\"battle_just_ended\", &State::battle_just_ended)\n+      .def_readwrite(\"battle_won\", &State::battle_won)\n+      .def_readwrite(\"waiting_for_restart\", &State::waiting_for_restart)\n+      .def_readwrite(\"last_battle_ended\", &State::last_battle_ended)\n+      .def_readwrite(\"img_mode\", &State::img_mode)\n+      .def_property(\"screen_position\", RWPAIR(State, screen_position, int))\n+      .def_readwrite(\"visibility\", &State::visibility)\n+      .def_property(\"visibility_size\", RWPAIR(State, visibility_size, int))\n+      .def_readwrite(\"image\", &State::image)\n+      .def_property(\"image_size\", RWPAIR(State, image_size, int))\n+      .def_readwrite(\"aliveUnits\", &State::aliveUnits)\n+      .def_readwrite(\"aliveUnitsConsidered\", &State::aliveUnitsConsidered)\n+      .def_readwrite(\"units\", &State::units)\n+      .def_readonly(\"frame\", &State::frame)\n+      .def(\n+          py::init<bool, std::set<BW::UnitType>>(),\n+          py::arg(\"microBattles\") = false,\n+          py::arg(\"onlyConsideredTypes\") = std::set<BW::UnitType>())\n+      .def_property(\n+          \"only_consider_types\",\n+          &State::onlyConsiderTypes,\n+          &State::setOnlyConsiderTypes)\n+      .def(\"reset\", &State::reset);","path":"py/pystate.cpp","position":57,"original_position":57,"commit_id":"ededd6a9b579a934a2af17e3fd54d86773dfb4a8","original_commit_id":"ededd6a9b579a934a2af17e3fd54d86773dfb4a8","user":{"login":"jgehring","id":88510,"avatar_url":"https://avatars2.githubusercontent.com/u/88510?v=3","gravatar_id":"","url":"https://api.github.com/users/jgehring","html_url":"https://github.com/jgehring","followers_url":"https://api.github.com/users/jgehring/followers","following_url":"https://api.github.com/users/jgehring/following{/other_user}","gists_url":"https://api.github.com/users/jgehring/gists{/gist_id}","starred_url":"https://api.github.com/users/jgehring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgehring/subscriptions","organizations_url":"https://api.github.com/users/jgehring/orgs","repos_url":"https://api.github.com/users/jgehring/repos","events_url":"https://api.github.com/users/jgehring/events{/privacy}","received_events_url":"https://api.github.com/users/jgehring/received_events","type":"User","site_admin":false},"body":"What's the plan for the map data tensors?","created_at":"2017-04-07T21:23:52Z","updated_at":"2017-04-07T21:45:40Z","html_url":"https://github.com/TorchCraft/TorchCraft/pull/116#discussion_r110485874","pull_request_url":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/116","_links":{"self":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/comments/110485874"},"html":{"href":"https://github.com/TorchCraft/TorchCraft/pull/116#discussion_r110485874"},"pull_request":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/116"}}},"pull_request":{"url":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/116","id":114879294,"html_url":"https://github.com/TorchCraft/TorchCraft/pull/116","diff_url":"https://github.com/TorchCraft/TorchCraft/pull/116.diff","patch_url":"https://github.com/TorchCraft/TorchCraft/pull/116.patch","issue_url":"https://api.github.com/repos/TorchCraft/TorchCraft/issues/116","number":116,"state":"open","locked":false,"title":"Implements a Python client","user":{"login":"ebetica","id":3605224,"avatar_url":"https://avatars0.githubusercontent.com/u/3605224?v=3","gravatar_id":"","url":"https://api.github.com/users/ebetica","html_url":"https://github.com/ebetica","followers_url":"https://api.github.com/users/ebetica/followers","following_url":"https://api.github.com/users/ebetica/following{/other_user}","gists_url":"https://api.github.com/users/ebetica/gists{/gist_id}","starred_url":"https://api.github.com/users/ebetica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebetica/subscriptions","organizations_url":"https://api.github.com/users/ebetica/orgs","repos_url":"https://api.github.com/users/ebetica/repos","events_url":"https://api.github.com/users/ebetica/events{/privacy}","received_events_url":"https://api.github.com/users/ebetica/received_events","type":"User","site_admin":false},"body":"For #1. I'm making this alpha for now, since all I tested was replays and attack closest, but everything _should_ work on the develop branch. It requires zstd to work. Simply do `python setup.py install` and run `example.py` for attack closest.","created_at":"2017-04-07T18:58:49Z","updated_at":"2017-04-07T21:45:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60f0c485c12679e020d43392202f3bc723620dca","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/116/commits","review_comments_url":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/116/comments","review_comment_url":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TorchCraft/TorchCraft/issues/116/comments","statuses_url":"https://api.github.com/repos/TorchCraft/TorchCraft/statuses/ededd6a9b579a934a2af17e3fd54d86773dfb4a8","head":{"label":"ebetica:python","ref":"python","sha":"ededd6a9b579a934a2af17e3fd54d86773dfb4a8","user":{"login":"ebetica","id":3605224,"avatar_url":"https://avatars0.githubusercontent.com/u/3605224?v=3","gravatar_id":"","url":"https://api.github.com/users/ebetica","html_url":"https://github.com/ebetica","followers_url":"https://api.github.com/users/ebetica/followers","following_url":"https://api.github.com/users/ebetica/following{/other_user}","gists_url":"https://api.github.com/users/ebetica/gists{/gist_id}","starred_url":"https://api.github.com/users/ebetica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebetica/subscriptions","organizations_url":"https://api.github.com/users/ebetica/orgs","repos_url":"https://api.github.com/users/ebetica/repos","events_url":"https://api.github.com/users/ebetica/events{/privacy}","received_events_url":"https://api.github.com/users/ebetica/received_events","type":"User","site_admin":false},"repo":{"id":78465026,"name":"TorchCraft","full_name":"ebetica/TorchCraft","owner":{"login":"ebetica","id":3605224,"avatar_url":"https://avatars0.githubusercontent.com/u/3605224?v=3","gravatar_id":"","url":"https://api.github.com/users/ebetica","html_url":"https://github.com/ebetica","followers_url":"https://api.github.com/users/ebetica/followers","following_url":"https://api.github.com/users/ebetica/following{/other_user}","gists_url":"https://api.github.com/users/ebetica/gists{/gist_id}","starred_url":"https://api.github.com/users/ebetica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebetica/subscriptions","organizations_url":"https://api.github.com/users/ebetica/orgs","repos_url":"https://api.github.com/users/ebetica/repos","events_url":"https://api.github.com/users/ebetica/events{/privacy}","received_events_url":"https://api.github.com/users/ebetica/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ebetica/TorchCraft","description":"Connecting Torch to StarCraft","fork":true,"url":"https://api.github.com/repos/ebetica/TorchCraft","forks_url":"https://api.github.com/repos/ebetica/TorchCraft/forks","keys_url":"https://api.github.com/repos/ebetica/TorchCraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ebetica/TorchCraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ebetica/TorchCraft/teams","hooks_url":"https://api.github.com/repos/ebetica/TorchCraft/hooks","issue_events_url":"https://api.github.com/repos/ebetica/TorchCraft/issues/events{/number}","events_url":"https://api.github.com/repos/ebetica/TorchCraft/events","assignees_url":"https://api.github.com/repos/ebetica/TorchCraft/assignees{/user}","branches_url":"https://api.github.com/repos/ebetica/TorchCraft/branches{/branch}","tags_url":"https://api.github.com/repos/ebetica/TorchCraft/tags","blobs_url":"https://api.github.com/repos/ebetica/TorchCraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ebetica/TorchCraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ebetica/TorchCraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/ebetica/TorchCraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ebetica/TorchCraft/statuses/{sha}","languages_url":"https://api.github.com/repos/ebetica/TorchCraft/languages","stargazers_url":"https://api.github.com/repos/ebetica/TorchCraft/stargazers","contributors_url":"https://api.github.com/repos/ebetica/TorchCraft/contributors","subscribers_url":"https://api.github.com/repos/ebetica/TorchCraft/subscribers","subscription_url":"https://api.github.com/repos/ebetica/TorchCraft/subscription","commits_url":"https://api.github.com/repos/ebetica/TorchCraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/ebetica/TorchCraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/ebetica/TorchCraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/ebetica/TorchCraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/ebetica/TorchCraft/contents/{+path}","compare_url":"https://api.github.com/repos/ebetica/TorchCraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ebetica/TorchCraft/merges","archive_url":"https://api.github.com/repos/ebetica/TorchCraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ebetica/TorchCraft/downloads","issues_url":"https://api.github.com/repos/ebetica/TorchCraft/issues{/number}","pulls_url":"https://api.github.com/repos/ebetica/TorchCraft/pulls{/number}","milestones_url":"https://api.github.com/repos/ebetica/TorchCraft/milestones{/number}","notifications_url":"https://api.github.com/repos/ebetica/TorchCraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ebetica/TorchCraft/labels{/name}","releases_url":"https://api.github.com/repos/ebetica/TorchCraft/releases{/id}","deployments_url":"https://api.github.com/repos/ebetica/TorchCraft/deployments","created_at":"2017-01-09T20:15:07Z","updated_at":"2017-01-09T20:15:10Z","pushed_at":"2017-04-07T18:59:06Z","git_url":"git://github.com/ebetica/TorchCraft.git","ssh_url":"git@github.com:ebetica/TorchCraft.git","clone_url":"https://github.com/ebetica/TorchCraft.git","svn_url":"https://github.com/ebetica/TorchCraft","homepage":"","size":5610,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"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":"TorchCraft:develop","ref":"develop","sha":"8f63e8b3a794873f1bea5da2ccac89ecadc335ba","user":{"login":"TorchCraft","id":20209289,"avatar_url":"https://avatars3.githubusercontent.com/u/20209289?v=3","gravatar_id":"","url":"https://api.github.com/users/TorchCraft","html_url":"https://github.com/TorchCraft","followers_url":"https://api.github.com/users/TorchCraft/followers","following_url":"https://api.github.com/users/TorchCraft/following{/other_user}","gists_url":"https://api.github.com/users/TorchCraft/gists{/gist_id}","starred_url":"https://api.github.com/users/TorchCraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TorchCraft/subscriptions","organizations_url":"https://api.github.com/users/TorchCraft/orgs","repos_url":"https://api.github.com/users/TorchCraft/repos","events_url":"https://api.github.com/users/TorchCraft/events{/privacy}","received_events_url":"https://api.github.com/users/TorchCraft/received_events","type":"Organization","site_admin":false},"repo":{"id":75440660,"name":"TorchCraft","full_name":"TorchCraft/TorchCraft","owner":{"login":"TorchCraft","id":20209289,"avatar_url":"https://avatars3.githubusercontent.com/u/20209289?v=3","gravatar_id":"","url":"https://api.github.com/users/TorchCraft","html_url":"https://github.com/TorchCraft","followers_url":"https://api.github.com/users/TorchCraft/followers","following_url":"https://api.github.com/users/TorchCraft/following{/other_user}","gists_url":"https://api.github.com/users/TorchCraft/gists{/gist_id}","starred_url":"https://api.github.com/users/TorchCraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TorchCraft/subscriptions","organizations_url":"https://api.github.com/users/TorchCraft/orgs","repos_url":"https://api.github.com/users/TorchCraft/repos","events_url":"https://api.github.com/users/TorchCraft/events{/privacy}","received_events_url":"https://api.github.com/users/TorchCraft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TorchCraft/TorchCraft","description":"Connecting Torch to StarCraft","fork":false,"url":"https://api.github.com/repos/TorchCraft/TorchCraft","forks_url":"https://api.github.com/repos/TorchCraft/TorchCraft/forks","keys_url":"https://api.github.com/repos/TorchCraft/TorchCraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TorchCraft/TorchCraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TorchCraft/TorchCraft/teams","hooks_url":"https://api.github.com/repos/TorchCraft/TorchCraft/hooks","issue_events_url":"https://api.github.com/repos/TorchCraft/TorchCraft/issues/events{/number}","events_url":"https://api.github.com/repos/TorchCraft/TorchCraft/events","assignees_url":"https://api.github.com/repos/TorchCraft/TorchCraft/assignees{/user}","branches_url":"https://api.github.com/repos/TorchCraft/TorchCraft/branches{/branch}","tags_url":"https://api.github.com/repos/TorchCraft/TorchCraft/tags","blobs_url":"https://api.github.com/repos/TorchCraft/TorchCraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TorchCraft/TorchCraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TorchCraft/TorchCraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/TorchCraft/TorchCraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TorchCraft/TorchCraft/statuses/{sha}","languages_url":"https://api.github.com/repos/TorchCraft/TorchCraft/languages","stargazers_url":"https://api.github.com/repos/TorchCraft/TorchCraft/stargazers","contributors_url":"https://api.github.com/repos/TorchCraft/TorchCraft/contributors","subscribers_url":"https://api.github.com/repos/TorchCraft/TorchCraft/subscribers","subscription_url":"https://api.github.com/repos/TorchCraft/TorchCraft/subscription","commits_url":"https://api.github.com/repos/TorchCraft/TorchCraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/TorchCraft/TorchCraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/TorchCraft/TorchCraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/TorchCraft/TorchCraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/TorchCraft/TorchCraft/contents/{+path}","compare_url":"https://api.github.com/repos/TorchCraft/TorchCraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TorchCraft/TorchCraft/merges","archive_url":"https://api.github.com/repos/TorchCraft/TorchCraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TorchCraft/TorchCraft/downloads","issues_url":"https://api.github.com/repos/TorchCraft/TorchCraft/issues{/number}","pulls_url":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls{/number}","milestones_url":"https://api.github.com/repos/TorchCraft/TorchCraft/milestones{/number}","notifications_url":"https://api.github.com/repos/TorchCraft/TorchCraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TorchCraft/TorchCraft/labels{/name}","releases_url":"https://api.github.com/repos/TorchCraft/TorchCraft/releases{/id}","deployments_url":"https://api.github.com/repos/TorchCraft/TorchCraft/deployments","created_at":"2016-12-03T00:04:58Z","updated_at":"2017-04-07T03:32:18Z","pushed_at":"2017-04-07T20:22:42Z","git_url":"git://github.com/TorchCraft/TorchCraft.git","ssh_url":"git@github.com:TorchCraft/TorchCraft.git","clone_url":"https://github.com/TorchCraft/TorchCraft.git","svn_url":"https://github.com/TorchCraft/TorchCraft","homepage":"","size":1123,"stargazers_count":678,"watchers_count":678,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":104,"mirror_url":null,"open_issues_count":8,"forks":104,"open_issues":8,"watchers":678,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/116"},"html":{"href":"https://github.com/TorchCraft/TorchCraft/pull/116"},"issue":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/issues/116"},"comments":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/TorchCraft/TorchCraft/statuses/ededd6a9b579a934a2af17e3fd54d86773dfb4a8"}}}}
{"actor":{"display_login":"jgehring"}}