-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…1722 (#1992) * matutils.unitvec bug As requested, I have edited the fix to ignore dtype size. I use np.issubtype to check input type and handle appropriately before return to ensure non-integer output. * matutils.unitvec fix tests Tests to ensure float output for both float and integer inputs. * unitvec equal input and return types * Update and rename test_unitvec to test_unitvec.py * Update matutils.py * Update matutils.py * Update test_unitvec.py * Update and rename gensim/test_unitvec.py to gensim/test/test_matutils.py * Update matutils.py * Update test_matutils.py * Update test_matutils.py * Update following review Removed leading spaces, which is the source of the PEP8/travis errors. Sorry, only just learnt from you what these actually are :) Also updated the code to include 'if return_norm' statement from the sparse array case. (I can't remember why I actually removed this in the first place.) * Update: attempt to solve Travis errors * Update test_matutils.py * Update matutils.py * Update matutils.py * Update test_matutils.py * Addressing travis errors * Remove unnecessary dtype assignment * return_norm statements for array instance case * Update test_matutils.py * Reduce line repetition * Reduce repeated lines * Update test_matutils.py * Remove some redundant code from unitvec This is what I have done based on Jayanti's suggestion of redundant code. Let me know if I have misunderstood. * UnitvecTestCase update Simplified tha manual_unitvec method and created a separate test for each `arrtype, dtype` pair, as suggested. * Small typo fix * Trailing white-space fix for Travis * Improve code quality and remove no-op
- Loading branch information
1 parent
760c6f4
commit 8daace2
Showing
2 changed files
with
111 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters