Skip to content

Commit

Permalink
#156 and #536 Unit-tests accelerated tests. Considering limited amoun…
Browse files Browse the repository at this point in the history
…t of documents for iteration.
  • Loading branch information
nicolay-r committed Dec 27, 2023
1 parent b76c236 commit 0e4cc7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/contrib/source/test_nerel.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def test(self):
assert(isinstance(brat_relation, BratRelation))
print(brat_relation.SourceID, brat_relation.TargetID, brat_relation.Type)

def test_all_documents(self):
def test_all_documents(self, docs_limit=5):
doc_reader = NerelDocReader(version=DEFAULT_VERSION)
filenames_by_ids, folding = NerelIOUtils.read_dataset_split(version=DEFAULT_VERSION)
filenames_by_ids, folding = NerelIOUtils.read_dataset_split(version=DEFAULT_VERSION, docs_limit=docs_limit)
for doc_id in tqdm(itertools.chain.from_iterable(folding.values())):
doc_reader.read_document(filename=filenames_by_ids[doc_id], doc_id=0)
4 changes: 2 additions & 2 deletions tests/contrib/source/test_nerel_bio.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def test(self):
assert(isinstance(brat_relation, BratRelation))
print(brat_relation.SourceID, brat_relation.TargetID, brat_relation.Type)

def test_all_documents(self):
def test_all_documents(self, docs_limit=5):
doc_reader = NerelBioDocReader(version=DEFAULT_VERSION)
filenames_by_ids, folding = NerelBioIOUtils.read_dataset_split(version=DEFAULT_VERSION)
filenames_by_ids, folding = NerelBioIOUtils.read_dataset_split(version=DEFAULT_VERSION, docs_limit=docs_limit)
for doc_id in tqdm(itertools.chain.from_iterable(folding.values())):
doc_reader.read_document(filename=filenames_by_ids[doc_id], doc_id=0)

0 comments on commit 0e4cc7f

Please sign in to comment.