{"action":"created","issue":{"url":"https://api.github.com/repos/bastibe/transplant/issues/17","repository_url":"https://api.github.com/repos/bastibe/transplant","labels_url":"https://api.github.com/repos/bastibe/transplant/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/bastibe/transplant/issues/17/comments","events_url":"https://api.github.com/repos/bastibe/transplant/issues/17/events","html_url":"https://github.com/bastibe/transplant/issues/17","id":189456109,"number":17,"title":"cell2mat fails for the shape due to different data types when using msgpack","user":{"login":"dani-l","id":3208721,"avatar_url":"https://avatars.githubusercontent.com/u/3208721?v=3","gravatar_id":"","url":"https://api.github.com/users/dani-l","html_url":"https://github.com/dani-l","followers_url":"https://api.github.com/users/dani-l/followers","following_url":"https://api.github.com/users/dani-l/following{/other_user}","gists_url":"https://api.github.com/users/dani-l/gists{/gist_id}","starred_url":"https://api.github.com/users/dani-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dani-l/subscriptions","organizations_url":"https://api.github.com/users/dani-l/orgs","repos_url":"https://api.github.com/users/dani-l/repos","events_url":"https://api.github.com/users/dani-l/events{/privacy}","received_events_url":"https://api.github.com/users/dani-l/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-15T17:30:40Z","updated_at":"2016-11-16T09:21:01Z","closed_at":null,"body":"When using transplant, I got an error \"All contents of the input cell array must be of the same data type. (MATLAB:cell2mat:MixedDataTypes)\". It turns out that this happens in the function decode_matrix() of transplant_remote.m when trying to convert the shape to a matrix. The different entries of the shape are stored as the smallest fitting integer type which causes cell2mat to fail.\r\n\r\nIn decode_matrix():\r\n```\r\ndisp(value{3});\r\n    [7479]    [3]\r\ndisp(class(value{3}));\r\n    cell\r\ndisp(class(value{3}{1}));\r\n    uint16\r\ndisp(class(value{3}{2}));\r\n    uint8\r\n```\r\nAs a quick fix, I changed the python side to transmit the shape as floats, but I don't know transplant and msgpack good enough to suggest an elegant solution."},"comment":{"url":"https://api.github.com/repos/bastibe/transplant/issues/comments/260894850","html_url":"https://github.com/bastibe/transplant/issues/17#issuecomment-260894850","issue_url":"https://api.github.com/repos/bastibe/transplant/issues/17","id":260894850,"user":{"login":"dani-l","id":3208721,"avatar_url":"https://avatars.githubusercontent.com/u/3208721?v=3","gravatar_id":"","url":"https://api.github.com/users/dani-l","html_url":"https://github.com/dani-l","followers_url":"https://api.github.com/users/dani-l/followers","following_url":"https://api.github.com/users/dani-l/following{/other_user}","gists_url":"https://api.github.com/users/dani-l/gists{/gist_id}","starred_url":"https://api.github.com/users/dani-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dani-l/subscriptions","organizations_url":"https://api.github.com/users/dani-l/orgs","repos_url":"https://api.github.com/users/dani-l/repos","events_url":"https://api.github.com/users/dani-l/events{/privacy}","received_events_url":"https://api.github.com/users/dani-l/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T09:21:01Z","updated_at":"2016-11-16T09:21:01Z","body":"A two-dimensional numpy array.\r\n\r\nThis fails on my system (Matlab R2015b, msgpack 1.3.0, current transplant from master):\r\n\r\n```python\r\nimport numpy as np\r\nfrom transplant import Matlab\r\nm = Matlab()\r\nprint(m.sqrt(np.ones((1, 256))))\r\n```\r\n\r\nWith (1, 255) it still works as both shape entires are uint8."}}
{"actor":{"display_login":"dani-l"}}