Skip to content

Commit

Permalink
fixing unit tests before release
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimieMurdock committed Apr 12, 2019
1 parent 679d3ab commit b285e95
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,6 +1,7 @@
*.py[cod]
*.so
vsm/model/_cgs_update.c
*.c
*.cpp

# Packages
*.egg
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -65,6 +65,7 @@
include_dirs=[numpy.get_include()]
)
),
zip_safe = False,
package_data = {'vsm': ['vsm/model/_cgs_update.pyx']},
dependency_links=['https://inpho.cogs.indiana.edu/pypi/czipfile/',
'https://inpho.cogs.indiana.edu/pypi/pymmseg/'],
Expand Down
14 changes: 9 additions & 5 deletions unit_tests/tests_corpus.py
Expand Up @@ -45,9 +45,12 @@ def test_SplitCorpus(self):

def test_apply_stoplist(self):
stopped_corpus = self.corpus.apply_stoplist(['I'])
new_ctx = all(np.equal(a, b) for a, b in zip(stopped_corpus.context_data[0],
np.array([(1,'Veni'), (2,'Vidi'),
(3,'Vici')], dtype=[('idx', '<i8'), ('sent', '|S6')])))
print(stopped_corpus.context_data[0].dtype)
new_ctx = all(a == b
for a, b in zip(
stopped_corpus.context_data[0],
np.array([(1,'Veni'), (2,'Vidi'), (3,'Vici')], dtype=[('idx', '<i8'), ('sentence_label', 'S6')])
))
self.assertTrue(new_ctx, msg=None)
self.assertItemsEqual(['I'], stopped_corpus.stopped_words)

Expand Down Expand Up @@ -88,10 +91,11 @@ def test_ValidateIndices(self):

def test_RemoveEmpty(self):
self.bc.remove_empty()
new_ctx = all(np.equal(a, b) for a,b in zip(self.bc.context_data[0],
print(self.bc.context_data[0].dtype)
new_ctx = all(a == b for a,b in zip(self.bc.context_data[0],
np.array([(3,'doc0'), (5,'doc1'),
(7,'doc2'), (11,'doc3'), (15,'doc5'), (18,'doc6'),
(20,'doc7')], dtype=[('idx', '<i8'), ('sent', '|S6')])))
(20,'doc7')], dtype=[('idx', '<i8'), ('document_label', '<U4')])))
self.assertTrue(new_ctx, msg=None)

def test_ViewMetadata(self):
Expand Down

0 comments on commit b285e95

Please sign in to comment.