{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5230","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5230/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5230/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5230/events","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5230","id":105451553,"number":5230,"title":"[MRG+1] split tree module into several packages","user":{"login":"jmschrei","id":3916816,"avatar_url":"https://avatars.githubusercontent.com/u/3916816?v=3","gravatar_id":"","url":"https://api.github.com/users/jmschrei","html_url":"https://github.com/jmschrei","followers_url":"https://api.github.com/users/jmschrei/followers","following_url":"https://api.github.com/users/jmschrei/following{/other_user}","gists_url":"https://api.github.com/users/jmschrei/gists{/gist_id}","starred_url":"https://api.github.com/users/jmschrei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmschrei/subscriptions","organizations_url":"https://api.github.com/users/jmschrei/orgs","repos_url":"https://api.github.com/users/jmschrei/repos","events_url":"https://api.github.com/users/jmschrei/events{/privacy}","received_events_url":"https://api.github.com/users/jmschrei/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-09-08T19:18:06Z","updated_at":"2015-09-09T11:05:56Z","closed_at":"2015-09-09T11:04:02Z","pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5230","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5230","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/5230.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/5230.patch"},"body":"This pull request handles splitting `_tree.pyx` into `_tree.pyx` with Tree and TreeBuilders, `_splitter.pyx` with all splitters and split records, `_criterion.pyx` with all criteria, and moves some functions into `_utils.pyx`. No code is changed, simply moved, in this PR. I almost have this working, with all unit tests passing except those which trigger a specific segfault. The segfault relates to the following function:\r\n\r\n```\r\ncdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size):\r\n    \"\"\"Encapsulate data into a 1D numpy array of intp's.\"\"\"\r\n    cdef np.npy_intp shape[1]\r\n    shape[0] = <np.npy_intp> size\r\n    return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data)\r\n```\r\n\r\nspecifically, this call:\r\n\r\n```\r\nnp.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data)\r\n```\r\n\r\nIn the test case, `shape = 1`, `data = [ 2 ]`, and it triggers a segfault. I have been reading about `PyArray_SimpleNewFromData` but figured that it might be easier to ask. So, (1) do you agree with this layout, and (2) do you know why this segfault is being triggered? Thanks!\r\n\r\ncc @glouppe @arjoly @ogrisel "},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/138876861","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5230#issuecomment-138876861","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5230","id":138876861,"user":{"login":"arjoly","id":1274722,"avatar_url":"https://avatars.githubusercontent.com/u/1274722?v=3","gravatar_id":"","url":"https://api.github.com/users/arjoly","html_url":"https://github.com/arjoly","followers_url":"https://api.github.com/users/arjoly/followers","following_url":"https://api.github.com/users/arjoly/following{/other_user}","gists_url":"https://api.github.com/users/arjoly/gists{/gist_id}","starred_url":"https://api.github.com/users/arjoly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjoly/subscriptions","organizations_url":"https://api.github.com/users/arjoly/orgs","repos_url":"https://api.github.com/users/arjoly/repos","events_url":"https://api.github.com/users/arjoly/events{/privacy}","received_events_url":"https://api.github.com/users/arjoly/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T11:05:56Z","updated_at":"2015-09-09T11:05:56Z","body":"thanks @jmschrei I am eager to see new speed up! :-)"}}