Skip to content

Commit

Permalink
Error messages if dataset validation fails (#11)
Browse files Browse the repository at this point in the history
* Error messages if dataset validation fails
  • Loading branch information
andrewyates committed Jun 7, 2021
1 parent 92c3034 commit f3180e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion diffir/__init__.py
@@ -1,4 +1,4 @@
__version__ = "0.1.0"
__version__ = "0.2.0"

from diffir.weight import Weight
from diffir.weight.custom import CustomWeight
Expand Down
5 changes: 2 additions & 3 deletions diffir/run.py
Expand Up @@ -378,9 +378,8 @@ def json(self, run_1_fn, run_2_fn=None):
run_2 = load_trec_run(run_2_fn) if run_2_fn is not None else None

dataset = ir_datasets.load(self.dataset)
assert dataset.has_docs()
# TODO: handle the case without qrels
assert dataset.has_queries()
assert dataset.has_docs(), "dataset has no documents; maybe you're missing a partition like '/trec-dl-2020'"
assert dataset.has_queries(), "dataset has no queries; maybe you're missing a partition like '/trec-dl-2020'"
diff_queries, qid2diff, metric_name, qid2qrelscores = self.measure.query_differences(run_1, run_2, dataset=dataset)
# _logger.info(diff_queries)
diff_query_objects = self.create_query_objects(
Expand Down

0 comments on commit f3180e7

Please sign in to comment.