{"action":"created","comment":{"url":"https://api.github.com/repos/dib-lab/khmer/pulls/comments/31156546","id":31156546,"diff_hunk":"@@ -3758,42 +3754,35 @@ static PyObject * khmer_labelhash_new(PyTypeObject *type, PyObject *args,\n     self = (khmer_KLabelHash_Object*)type->tp_alloc(type, 0);\n \n     if (self != NULL) {\n-        WordLength k = 0;\n-        PyListObject * sizes_list_o = NULL;\n+        PyObject * hashtable_o;\n+        khmer::Hashtable * hashtable = NULL;\n \n-        if (!PyArg_ParseTuple(args, \"bO!\", &k, &PyList_Type, &sizes_list_o)) {\n+        if (!PyArg_ParseTuple(args, \"O\", &hashtable_o)) {\n             Py_DECREF(self);\n             return NULL;\n         }\n \n-        std::vector<HashIntoType> sizes;\n-        Py_ssize_t sizes_list_o_length = PyList_GET_SIZE(sizes_list_o);\n-        for (Py_ssize_t i = 0; i < sizes_list_o_length; i++) {\n-            PyObject * size_o = PyList_GET_ITEM(sizes_list_o, i);\n-            if (PyLong_Check(size_o)) {\n-                sizes.push_back((HashIntoType) PyLong_AsUnsignedLongLong(size_o));\n-            } else if (PyInt_Check(size_o)) {\n-                sizes.push_back((HashIntoType) PyInt_AsLong(size_o));\n-            } else if (PyFloat_Check(size_o)) {\n-                sizes.push_back((HashIntoType) PyFloat_AS_DOUBLE(size_o));\n-            } else {\n-                Py_DECREF(self);\n-                PyErr_SetString(PyExc_TypeError,\n-                                \"2nd argument must be a list of ints, longs, or floats\");\n-                return NULL;\n-            }\n+        if (PyObject_TypeCheck(hashtable_o, &khmer_KHashbits_Type)) {\n+          khmer_KHashbits_Object * kho = (khmer_KHashbits_Object *) hashtable_o;\n+          hashtable = kho->hashbits;\n+        }\n+        else if (PyObject_TypeCheck(hashtable_o, &khmer_KCountingHash_Type)) {\n+          khmer_KCountingHash_Object * cho = (khmer_KCountingHash_Object *) hashtable_o;\n+          hashtable = cho->counting;\n+        }\n+        else {\n+          PyErr_SetString(PyExc_ValueError,\n+                          \"graph object must be a NodeGraph or CountGraph\");\n+          Py_DECREF(self);\n+          return NULL;","path":"khmer/_khmermodule.cc","position":63,"original_position":63,"commit_id":"99d92ff14269c7b7f47322eb364ed43a67d0168d","original_commit_id":"b412bf50854da1da0f60124ef2431ac50f4ea127","user":{"login":"ctb","id":51016,"avatar_url":"https://avatars.githubusercontent.com/u/51016?v=3","gravatar_id":"","url":"https://api.github.com/users/ctb","html_url":"https://github.com/ctb","followers_url":"https://api.github.com/users/ctb/followers","following_url":"https://api.github.com/users/ctb/following{/other_user}","gists_url":"https://api.github.com/users/ctb/gists{/gist_id}","starred_url":"https://api.github.com/users/ctb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctb/subscriptions","organizations_url":"https://api.github.com/users/ctb/orgs","repos_url":"https://api.github.com/users/ctb/repos","events_url":"https://api.github.com/users/ctb/events{/privacy}","received_events_url":"https://api.github.com/users/ctb/received_events","type":"User","site_admin":false},"body":"How odd. I verified that I got exactly that error message, and that it's present nowhere else in the code base, so it's covered!","created_at":"2015-05-27T17:08:18Z","updated_at":"2015-05-27T17:08:18Z","html_url":"https://github.com/dib-lab/khmer/pull/1021#discussion_r31156546","pull_request_url":"https://api.github.com/repos/dib-lab/khmer/pulls/1021","_links":{"self":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/comments/31156546"},"html":{"href":"https://github.com/dib-lab/khmer/pull/1021#discussion_r31156546"},"pull_request":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/1021"}}},"pull_request":{"url":"https://api.github.com/repos/dib-lab/khmer/pulls/1021","id":35895949,"html_url":"https://github.com/dib-lab/khmer/pull/1021","diff_url":"https://github.com/dib-lab/khmer/pull/1021.diff","patch_url":"https://github.com/dib-lab/khmer/pull/1021.patch","issue_url":"https://api.github.com/repos/dib-lab/khmer/issues/1021","number":1021,"state":"open","locked":false,"title":"Some hacking on labelhash.","user":{"login":"ctb","id":51016,"avatar_url":"https://avatars.githubusercontent.com/u/51016?v=3","gravatar_id":"","url":"https://api.github.com/users/ctb","html_url":"https://github.com/ctb","followers_url":"https://api.github.com/users/ctb/followers","following_url":"https://api.github.com/users/ctb/following{/other_user}","gists_url":"https://api.github.com/users/ctb/gists{/gist_id}","starred_url":"https://api.github.com/users/ctb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctb/subscriptions","organizations_url":"https://api.github.com/users/ctb/orgs","repos_url":"https://api.github.com/users/ctb/repos","events_url":"https://api.github.com/users/ctb/events{/privacy}","received_events_url":"https://api.github.com/users/ctb/received_events","type":"User","site_admin":false},"body":"@camillescott will \"like\" this, I suspect... for some value of \"like\".\r\n\r\nIf this branch proves useful we should make the Python type hierarchy for Hashtable/CountingHash/Hashbits look more like the C++ object hierarchy. But let's see if it's useful first.\r\n","created_at":"2015-05-21T03:00:13Z","updated_at":"2015-05-27T17:08:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0fd0869ff5b2ef2b95aaedcc1d11ae2eea7f062","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dib-lab/khmer/pulls/1021/commits","review_comments_url":"https://api.github.com/repos/dib-lab/khmer/pulls/1021/comments","review_comment_url":"https://api.github.com/repos/dib-lab/khmer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dib-lab/khmer/issues/1021/comments","statuses_url":"https://api.github.com/repos/dib-lab/khmer/statuses/99d92ff14269c7b7f47322eb364ed43a67d0168d","head":{"label":"dib-lab:feature/labelgraph","ref":"feature/labelgraph","sha":"99d92ff14269c7b7f47322eb364ed43a67d0168d","user":{"login":"dib-lab","id":1740697,"avatar_url":"https://avatars.githubusercontent.com/u/1740697?v=3","gravatar_id":"","url":"https://api.github.com/users/dib-lab","html_url":"https://github.com/dib-lab","followers_url":"https://api.github.com/users/dib-lab/followers","following_url":"https://api.github.com/users/dib-lab/following{/other_user}","gists_url":"https://api.github.com/users/dib-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/dib-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dib-lab/subscriptions","organizations_url":"https://api.github.com/users/dib-lab/orgs","repos_url":"https://api.github.com/users/dib-lab/repos","events_url":"https://api.github.com/users/dib-lab/events{/privacy}","received_events_url":"https://api.github.com/users/dib-lab/received_events","type":"Organization","site_admin":false},"repo":{"id":4331833,"name":"khmer","full_name":"dib-lab/khmer","owner":{"login":"dib-lab","id":1740697,"avatar_url":"https://avatars.githubusercontent.com/u/1740697?v=3","gravatar_id":"","url":"https://api.github.com/users/dib-lab","html_url":"https://github.com/dib-lab","followers_url":"https://api.github.com/users/dib-lab/followers","following_url":"https://api.github.com/users/dib-lab/following{/other_user}","gists_url":"https://api.github.com/users/dib-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/dib-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dib-lab/subscriptions","organizations_url":"https://api.github.com/users/dib-lab/orgs","repos_url":"https://api.github.com/users/dib-lab/repos","events_url":"https://api.github.com/users/dib-lab/events{/privacy}","received_events_url":"https://api.github.com/users/dib-lab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dib-lab/khmer","description":"In-memory nucleotide sequence k-mer counting, filtering, graph traversal and more","fork":false,"url":"https://api.github.com/repos/dib-lab/khmer","forks_url":"https://api.github.com/repos/dib-lab/khmer/forks","keys_url":"https://api.github.com/repos/dib-lab/khmer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dib-lab/khmer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dib-lab/khmer/teams","hooks_url":"https://api.github.com/repos/dib-lab/khmer/hooks","issue_events_url":"https://api.github.com/repos/dib-lab/khmer/issues/events{/number}","events_url":"https://api.github.com/repos/dib-lab/khmer/events","assignees_url":"https://api.github.com/repos/dib-lab/khmer/assignees{/user}","branches_url":"https://api.github.com/repos/dib-lab/khmer/branches{/branch}","tags_url":"https://api.github.com/repos/dib-lab/khmer/tags","blobs_url":"https://api.github.com/repos/dib-lab/khmer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dib-lab/khmer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dib-lab/khmer/git/refs{/sha}","trees_url":"https://api.github.com/repos/dib-lab/khmer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dib-lab/khmer/statuses/{sha}","languages_url":"https://api.github.com/repos/dib-lab/khmer/languages","stargazers_url":"https://api.github.com/repos/dib-lab/khmer/stargazers","contributors_url":"https://api.github.com/repos/dib-lab/khmer/contributors","subscribers_url":"https://api.github.com/repos/dib-lab/khmer/subscribers","subscription_url":"https://api.github.com/repos/dib-lab/khmer/subscription","commits_url":"https://api.github.com/repos/dib-lab/khmer/commits{/sha}","git_commits_url":"https://api.github.com/repos/dib-lab/khmer/git/commits{/sha}","comments_url":"https://api.github.com/repos/dib-lab/khmer/comments{/number}","issue_comment_url":"https://api.github.com/repos/dib-lab/khmer/issues/comments{/number}","contents_url":"https://api.github.com/repos/dib-lab/khmer/contents/{+path}","compare_url":"https://api.github.com/repos/dib-lab/khmer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dib-lab/khmer/merges","archive_url":"https://api.github.com/repos/dib-lab/khmer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dib-lab/khmer/downloads","issues_url":"https://api.github.com/repos/dib-lab/khmer/issues{/number}","pulls_url":"https://api.github.com/repos/dib-lab/khmer/pulls{/number}","milestones_url":"https://api.github.com/repos/dib-lab/khmer/milestones{/number}","notifications_url":"https://api.github.com/repos/dib-lab/khmer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dib-lab/khmer/labels{/name}","releases_url":"https://api.github.com/repos/dib-lab/khmer/releases{/id}","created_at":"2012-05-15T03:52:53Z","updated_at":"2015-05-27T06:41:34Z","pushed_at":"2015-05-27T16:57:52Z","git_url":"git://github.com/dib-lab/khmer.git","ssh_url":"git@github.com:dib-lab/khmer.git","clone_url":"https://github.com/dib-lab/khmer.git","svn_url":"https://github.com/dib-lab/khmer","homepage":"http://khmer.readthedocs.org/","size":172671,"stargazers_count":231,"watchers_count":231,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":190,"mirror_url":null,"open_issues_count":274,"forks":190,"open_issues":274,"watchers":231,"default_branch":"master"}},"base":{"label":"dib-lab:master","ref":"master","sha":"6f184340e33a6c7f5eb39b7641d6fe4d211f50d2","user":{"login":"dib-lab","id":1740697,"avatar_url":"https://avatars.githubusercontent.com/u/1740697?v=3","gravatar_id":"","url":"https://api.github.com/users/dib-lab","html_url":"https://github.com/dib-lab","followers_url":"https://api.github.com/users/dib-lab/followers","following_url":"https://api.github.com/users/dib-lab/following{/other_user}","gists_url":"https://api.github.com/users/dib-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/dib-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dib-lab/subscriptions","organizations_url":"https://api.github.com/users/dib-lab/orgs","repos_url":"https://api.github.com/users/dib-lab/repos","events_url":"https://api.github.com/users/dib-lab/events{/privacy}","received_events_url":"https://api.github.com/users/dib-lab/received_events","type":"Organization","site_admin":false},"repo":{"id":4331833,"name":"khmer","full_name":"dib-lab/khmer","owner":{"login":"dib-lab","id":1740697,"avatar_url":"https://avatars.githubusercontent.com/u/1740697?v=3","gravatar_id":"","url":"https://api.github.com/users/dib-lab","html_url":"https://github.com/dib-lab","followers_url":"https://api.github.com/users/dib-lab/followers","following_url":"https://api.github.com/users/dib-lab/following{/other_user}","gists_url":"https://api.github.com/users/dib-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/dib-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dib-lab/subscriptions","organizations_url":"https://api.github.com/users/dib-lab/orgs","repos_url":"https://api.github.com/users/dib-lab/repos","events_url":"https://api.github.com/users/dib-lab/events{/privacy}","received_events_url":"https://api.github.com/users/dib-lab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dib-lab/khmer","description":"In-memory nucleotide sequence k-mer counting, filtering, graph traversal and more","fork":false,"url":"https://api.github.com/repos/dib-lab/khmer","forks_url":"https://api.github.com/repos/dib-lab/khmer/forks","keys_url":"https://api.github.com/repos/dib-lab/khmer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dib-lab/khmer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dib-lab/khmer/teams","hooks_url":"https://api.github.com/repos/dib-lab/khmer/hooks","issue_events_url":"https://api.github.com/repos/dib-lab/khmer/issues/events{/number}","events_url":"https://api.github.com/repos/dib-lab/khmer/events","assignees_url":"https://api.github.com/repos/dib-lab/khmer/assignees{/user}","branches_url":"https://api.github.com/repos/dib-lab/khmer/branches{/branch}","tags_url":"https://api.github.com/repos/dib-lab/khmer/tags","blobs_url":"https://api.github.com/repos/dib-lab/khmer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dib-lab/khmer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dib-lab/khmer/git/refs{/sha}","trees_url":"https://api.github.com/repos/dib-lab/khmer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dib-lab/khmer/statuses/{sha}","languages_url":"https://api.github.com/repos/dib-lab/khmer/languages","stargazers_url":"https://api.github.com/repos/dib-lab/khmer/stargazers","contributors_url":"https://api.github.com/repos/dib-lab/khmer/contributors","subscribers_url":"https://api.github.com/repos/dib-lab/khmer/subscribers","subscription_url":"https://api.github.com/repos/dib-lab/khmer/subscription","commits_url":"https://api.github.com/repos/dib-lab/khmer/commits{/sha}","git_commits_url":"https://api.github.com/repos/dib-lab/khmer/git/commits{/sha}","comments_url":"https://api.github.com/repos/dib-lab/khmer/comments{/number}","issue_comment_url":"https://api.github.com/repos/dib-lab/khmer/issues/comments{/number}","contents_url":"https://api.github.com/repos/dib-lab/khmer/contents/{+path}","compare_url":"https://api.github.com/repos/dib-lab/khmer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dib-lab/khmer/merges","archive_url":"https://api.github.com/repos/dib-lab/khmer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dib-lab/khmer/downloads","issues_url":"https://api.github.com/repos/dib-lab/khmer/issues{/number}","pulls_url":"https://api.github.com/repos/dib-lab/khmer/pulls{/number}","milestones_url":"https://api.github.com/repos/dib-lab/khmer/milestones{/number}","notifications_url":"https://api.github.com/repos/dib-lab/khmer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dib-lab/khmer/labels{/name}","releases_url":"https://api.github.com/repos/dib-lab/khmer/releases{/id}","created_at":"2012-05-15T03:52:53Z","updated_at":"2015-05-27T06:41:34Z","pushed_at":"2015-05-27T16:57:52Z","git_url":"git://github.com/dib-lab/khmer.git","ssh_url":"git@github.com:dib-lab/khmer.git","clone_url":"https://github.com/dib-lab/khmer.git","svn_url":"https://github.com/dib-lab/khmer","homepage":"http://khmer.readthedocs.org/","size":172671,"stargazers_count":231,"watchers_count":231,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":190,"mirror_url":null,"open_issues_count":274,"forks":190,"open_issues":274,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/1021"},"html":{"href":"https://github.com/dib-lab/khmer/pull/1021"},"issue":{"href":"https://api.github.com/repos/dib-lab/khmer/issues/1021"},"comments":{"href":"https://api.github.com/repos/dib-lab/khmer/issues/1021/comments"},"review_comments":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/1021/comments"},"review_comment":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/1021/commits"},"statuses":{"href":"https://api.github.com/repos/dib-lab/khmer/statuses/99d92ff14269c7b7f47322eb364ed43a67d0168d"}}}}