Skip to content

Commit

Permalink
fixes #32
Browse files Browse the repository at this point in the history
  • Loading branch information
kmckinnis committed Aug 18, 2016
1 parent c4587f7 commit 15cef93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

### Features
* Added the ability to add a previously existing list of IDs to the create command
* Changed the format of ID creation to (cual-id, UUID) instead of (UUID, cual-id) to make the --existing -ids function work with cual-ids. Changed label.py and fix.py to reflect these changes

### Bugs
* Bug fix: There was a small bug in the previous version that would occasionally cause issues when installing with conda
2 changes: 1 addition & 1 deletion cualid/fix.py
Expand Up @@ -7,7 +7,7 @@ def parse_ids(input_file, col):

def fix_ids(correct_input, input_to_check, thresh=.5):
corr_ids = parse_ids(correct_input, 0)
broke_ids = parse_ids(input_to_check, 1)
broke_ids = parse_ids(input_to_check, 0)

seen = set()
for broke_id in broke_ids:
Expand Down
28 changes: 14 additions & 14 deletions cualid/tests/test_fix.py
Expand Up @@ -63,20 +63,20 @@ def test_fix_ids_fix_all(self):
def test_parse_ids(self):
exp = ['23bb9', 'c0cab', '87696', '7869b', 'd50cc']
self.assertEqual(parse_ids(identical, 0), exp)
self.assertEqual(parse_ids(correct1, 1), exp)

correct1 = io.StringIO("c0b5d3ae-d2d4-4aa5-bd51-76c93e223bb9\t23bb9\n"
"0b95a10f-0610-434f-9734-4d2ac02c0cab\tc0cab\n"
"ef09be86-dfee-4ce1-84d4-e60b5df87696\t87696\n"
"c13f1644-cab9-4474-b674-1442efc7869b\t7869b\n"
"b60e7c07-bbf9-468c-a8f0-98639f2d50cc\td50cc\n")

correct2 = io.StringIO("9563938c-72db-4cf4-aa1c-b8843ce05576\t843ce05576\n"
"fdb1cca7-0a94-4725-95de-5d2c9dbf17fa\t2c9dbf17fa\n"
"296bb722-bdc1-40c9-b154-178f783cd158\t8f783cd158\n"
"1ab8e24e-3661-4a54-a2fc-c4c1afedcf74\tc1afedcf74\n"
"6c36f950-5462-489a-9292-8ff4b56fff8e\tf4b56fff8e\n"
"5f357627-14ad-4611-9706-040280dbdd77\t0280dbdd77\n")
self.assertEqual(parse_ids(correct1, 0), exp)

correct1 = io.StringIO("23bb9\tc0b5d3ae-d2d4-4aa5-bd51-76c93e223bb9\n"
"c0cab\t0b95a10f-0610-434f-9734-4d2ac02c0cab\n"
"87696\tef09be86-dfee-4ce1-84d4-e60b5df87696\n"
"7869b\tc13f1644-cab9-4474-b674-1442efc7869b\n"
"d50cc\tb60e7c07-bbf9-468c-a8f0-98639f2d50cc\n")

correct2 = io.StringIO("843ce05576\t9563938c-72db-4cf4-aa1c-b8843ce05576\n"
"2c9dbf17fa\tfdb1cca7-0a94-4725-95de-5d2c9dbf17fa\n"
"8f783cd158\t296bb722-bdc1-40c9-b154-178f783cd158\n"
"c1afedcf74\t1ab8e24e-3661-4a54-a2fc-c4c1afedcf74\n"
"f4b56fff8e\t6c36f950-5462-489a-9292-8ff4b56fff8e\n"
"0280dbdd77\t5f357627-14ad-4611-9706-040280dbdd77\n")

identical = io.StringIO("23bb9\n"
"c0cab\n"
Expand Down

0 comments on commit 15cef93

Please sign in to comment.