{"comment":{"url":"https://api.github.com/repos/SystemAnalysisDpt-CMC-MSU/ellipy/comments/31342019","html_url":"https://github.com/SystemAnalysisDpt-CMC-MSU/ellipy/commit/2eaff04a394e675eccaa8e5db93a1b00f78a9bb2#commitcomment-31342019","id":31342019,"node_id":"MDEzOkNvbW1pdENvbW1lbnQzMTM0MjAxOQ==","user":{"login":"irublev","id":4992575,"node_id":"MDQ6VXNlcjQ5OTI1NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/4992575?v=4","gravatar_id":"","url":"https://api.github.com/users/irublev","html_url":"https://github.com/irublev","followers_url":"https://api.github.com/users/irublev/followers","following_url":"https://api.github.com/users/irublev/following{/other_user}","gists_url":"https://api.github.com/users/irublev/gists{/gist_id}","starred_url":"https://api.github.com/users/irublev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irublev/subscriptions","organizations_url":"https://api.github.com/users/irublev/orgs","repos_url":"https://api.github.com/users/irublev/repos","events_url":"https://api.github.com/users/irublev/events{/privacy}","received_events_url":"https://api.github.com/users/irublev/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":null,"commit_id":"2eaff04a394e675eccaa8e5db93a1b00f78a9bb2","created_at":"2018-11-18T15:58:46Z","updated_at":"2018-11-18T15:58:46Z","author_association":"CONTRIBUTOR","body":"1) why dst_arr_size = len(dst_arr.shape) ? use https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.ndarray.ndim.html\r\n2) why do you need the code in lines 33-45 at all? it is much simpler:\r\nn_elems = 1 if dst_arr.ndim <= 2 else dst_arr.shape[2]\r\nn_vecs = 1 if dst_arr.ndim <= 1 else dst_arr.shape[1]\r\n3) consider chaning dtype=float to dtype=np.float64\r\n4) why do you need the following lines:\r\nif src_mat.shape == (0, 0) or src_mat.shape == (0,):\r\n        return np.array(np.empty(0), dtype=float)\r\nthis code is absent in the initial code, besides, if you need to check whether an array is empty you can implement this much simpler: just use np.size (see https://stackoverflow.com/questions/11295609/how-can-i-check-whether-the-numpy-array-is-empty-or-not)\r\n\r\nIn general, if you need to do something, please google this, for example, what concerns the emptyness, I myself just googled \"numpy isempty\"\r\n\r\n5) why do you need these tmp_vec and tmp_vec_len? you can just write:\r\nsrc_vec = np.expand_dims(src_mat[:, i_vec], axis=1)\r\n(the lines 54-56 are analogous)\r\n\r\nPlease, google, google and google again before you implement something, the solution may be much simpler than you can imagine at first glance.\r\n"}}
{"actor":{"display_login":"irublev"}}