-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Find integers and floats of equivalent values (#169)
* Finds integers and floats of equivalent values. Integers stored as floats or ints can be found using equivalent float or int values e.g. signac find a 1.0 returns jobs with sp.a = 1 or sp.a = 1.0 signac find a 1 returns jobs with sp.a = 1 or sp.a = 1.0 Modifies unit tests to accommodate change. Fixes #164 * Make type more explicit in collection.find_expression This was causing tests to fail on python2.7 where round() returns floating point values, whereas round() returns ints in python3. Change hash(round(value)) == hash(value) to round(value) == value to check if a value is an integer value (but may be a floating point data type). * Simplify type-checking logic and add comments Change made per request from code review (#169 (comment)). I also added a comment block to explain why we added the check there. * Tidy up imports in collection.py * Add Kelly to list of contributors * Use is_integer() to check if floats are integer-valued * Minor syntactic update. * Update changelog.
- Loading branch information
Showing
4 changed files
with
27 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ Bradley Dice | |
Tim Moore | ||
Pengji Zhou | ||
Eric Harper | ||
Kelly Wang |
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