Skip to content

Commit

Permalink
Merge pull request #91 from CogStack/develop
Browse files Browse the repository at this point in the history
Fixed tests and updated required python version to 3.7
  • Loading branch information
w-is-h authored Jul 27, 2021
2 parents 3387597 + 5b641cf commit 3aa9b9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A guide on how to use MedCAT is available in the [tutorial](https://github.com/C
- [MedCATservice](https://github.com/CogStack/MedCATservice) - implements the MedCAT NLP application as a service behind a REST API.
- [iCAT](https://github.com/CogStack/iCAT) - A docker container for CogStack/MedCAT/HuggingFace development in isolated environments.

## Install using PIP (Requires Python 3.6.1+)
## Install using PIP (Requires Python 3.7+)
0. Upgrade pip `pip install --upgrade pip`
1. Install MedCAT
- For macOS/linux: `pip install --upgrade medcat`
Expand Down
17 changes: 8 additions & 9 deletions tests/test_cdb_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#TESTS RUN IN ALPHABETICAL ORDER - CONTROLLING WITH '[class_letter]Class and test_[classletter subclassletter]' function syntax

class A_CDBMakerLoadTests(unittest.TestCase):

@classmethod
def setUpClass(cls):
print("Load test database csvs for load tests")
Expand Down Expand Up @@ -53,10 +53,10 @@ def test_af_cdb_name_to_cuis_output(self):
self.assertEqual(self.cdb.name2cuis, target_result)

def test_ag_cdb_cuis_to_tags_length(self):
self.assertEqual(len(self.cdb.cui2tags), 3, "Should equal 3")
self.assertEqual(len(self.cdb.cui2tags), 0, "Should equal 0")

def test_ah_cdb_cuis_to_tags_output(self):
target_result = {'C0000039': [], 'C0000139': [], 'C0000239': []}
target_result = {}
self.assertEqual(self.cdb.cui2tags, target_result)

def test_ai_cdb_cui_to_preferred_name_length(self):
Expand All @@ -67,17 +67,17 @@ def test_aj_cdb_cui_to_preferred_name_output(self):
self.assertEqual(self.cdb.cui2preferred_name, target_result)

def test_ak_cdb_cui_to_context_vectors_length(self):
self.assertEqual(len(self.cdb.cui2context_vectors), 3, "Should equal 3")
self.assertEqual(len(self.cdb.cui2context_vectors), 0, "Should equal 0")

def test_al_cdb_cui_to_context_vectors_output(self):
target_result = {'C0000039': {}, 'C0000139': {}, 'C0000239': {}}
target_result = {}
self.assertEqual(self.cdb.cui2context_vectors, target_result)

def test_am_cdb_cui_to_count_train_length(self):
self.assertEqual(len(self.cdb.cui2count_train), 3, "Should equal 3")
self.assertEqual(len(self.cdb.cui2count_train), 0, "Should equal 0")

def test_an_cdb_cui_to_count_train_output(self):
target_result = {'C0000039': 0, 'C0000139': 0, 'C0000239': 0}
target_result = {}
self.assertEqual(self.cdb.cui2count_train, target_result)

def test_ao_cdb_name_to_cui_to_status_length(self):
Expand Down Expand Up @@ -176,9 +176,8 @@ def test_bg_save_and_load_model_context_vectors(self):

def test_bh_reset_training(self):
self.cdb.reset_training()
target_result = {'C0000039': {}, 'C0000139': {}}
target_result = {}
self.assertEqual(self.cdb.cui2context_vectors, target_result)
self.assertEqual(self.cdb.cui2count_train['C0000139'], 0, "Count should equal 0")


if __name__ == '__main__':
Expand Down

0 comments on commit 3aa9b9b

Please sign in to comment.