{"action":"created","issue":{"url":"https://api.github.com/repos/Blosc/bcolz/issues/153","labels_url":"https://api.github.com/repos/Blosc/bcolz/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/Blosc/bcolz/issues/153/comments","events_url":"https://api.github.com/repos/Blosc/bcolz/issues/153/events","html_url":"https://github.com/Blosc/bcolz/pull/153","id":59454425,"number":153,"title":"Chunks class iterator","user":{"login":"FrancescElies","id":6558089,"avatar_url":"https://avatars.githubusercontent.com/u/6558089?v=3","gravatar_id":"","url":"https://api.github.com/users/FrancescElies","html_url":"https://github.com/FrancescElies","followers_url":"https://api.github.com/users/FrancescElies/followers","following_url":"https://api.github.com/users/FrancescElies/following{/other_user}","gists_url":"https://api.github.com/users/FrancescElies/gists{/gist_id}","starred_url":"https://api.github.com/users/FrancescElies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrancescElies/subscriptions","organizations_url":"https://api.github.com/users/FrancescElies/orgs","repos_url":"https://api.github.com/users/FrancescElies/repos","events_url":"https://api.github.com/users/FrancescElies/events{/privacy}","received_events_url":"https://api.github.com/users/FrancescElies/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-02T09:03:56Z","updated_at":"2015-03-05T19:09:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Blosc/bcolz/pulls/153","html_url":"https://github.com/Blosc/bcolz/pull/153","diff_url":"https://github.com/Blosc/bcolz/pull/153.diff","patch_url":"https://github.com/Blosc/bcolz/pull/153.patch"},"body":"Hi,\r\n\r\nthis PR is a proposal for a ```chunks class``` iterator, with two tests one for in-core and the other one for  out-of-core carray.\r\nIn case this changes are on the right path, would this fill the requirements to enable this kind of syntax ```for chunk_ in ca.chunks```?\r\n\r\nMany thanks in advance for your input,\r\n\r\nRegards,\r\nF. Elies"},"comment":{"url":"https://api.github.com/repos/Blosc/bcolz/issues/comments/77429923","html_url":"https://github.com/Blosc/bcolz/pull/153#issuecomment-77429923","issue_url":"https://api.github.com/repos/Blosc/bcolz/issues/153","id":77429923,"user":{"login":"esc","id":41563,"avatar_url":"https://avatars.githubusercontent.com/u/41563?v=3","gravatar_id":"","url":"https://api.github.com/users/esc","html_url":"https://github.com/esc","followers_url":"https://api.github.com/users/esc/followers","following_url":"https://api.github.com/users/esc/following{/other_user}","gists_url":"https://api.github.com/users/esc/gists{/gist_id}","starred_url":"https://api.github.com/users/esc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esc/subscriptions","organizations_url":"https://api.github.com/users/esc/orgs","repos_url":"https://api.github.com/users/esc/repos","events_url":"https://api.github.com/users/esc/events{/privacy}","received_events_url":"https://api.github.com/users/esc/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T19:09:48Z","updated_at":"2015-03-05T19:09:48Z","body":"And yes, I presume it would work, for example in ``sum``:\r\n\r\n```\r\ndiff --git c/bcolz/carray_ext.pyx i/bcolz/carray_ext.pyx\r\nindex f3f2b8d9dc..b073aff42b 100644\r\n--- c/bcolz/carray_ext.pyx\r\n+++ i/bcolz/carray_ext.pyx\r\n@@ -1712,7 +1712,7 @@ cdef class carray:\r\n \r\n         \"\"\"\r\n         cdef chunk chunk_\r\n-        cdef npy_intp nchunk, nchunks\r\n+        cdef npy_intp nchunks\r\n         cdef object result\r\n \r\n         if dtype is None:\r\n@@ -1730,8 +1730,7 @@ cdef class carray:\r\n         result = np.zeros(1, dtype=dtype)[0]\r\n \r\n         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)\r\n-        for nchunk from 0 <= nchunk < nchunks:\r\n-            chunk_ = self.chunks[nchunk]\r\n+        for chunk_ in self.chunks:\r\n             if chunk_.isconstant:\r\n                 result += chunk_.constant * self._chunklen\r\n             elif self._dtype.type == np.bool_:\r\n```"}}