EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/317027
Change subject: Add some vebose output on exceptions ...................................................................... Add some vebose output on exceptions Change-Id: Iaacee30b047f819645ad679eca891eb448bc3da7 --- M engineScore.py 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/relevanceForge refs/changes/27/317027/1 diff --git a/engineScore.py b/engineScore.py index 9dac6df..e3389c1 100755 --- a/engineScore.py +++ b/engineScore.py @@ -100,6 +100,7 @@ with open(cache_path, 'r') as f: return f.read().split("\n") except IOError: + debug("No cached query result available.") pass result = self._run_query() @@ -108,7 +109,7 @@ try: os.makedirs(self._cache_dir) except OSError: - # directory created since checking + debug("cache directory created since checking") pass with open(cache_path, 'w') as f: @@ -235,8 +236,13 @@ except KeyError: # @todo this shouldn't be necessary, but there is some sort # of utf8 round tripping problem that breaks a few queries + debug("failed to find query (%s) in scores" % (query)) pass # print(json.dumps(debug)) + + if len(queries) != len(debug): + print("Expected %d queries, but only got %d" % (len(queries), len(debug))) + return sum(ndcgs) / len(ndcgs) -- To view, visit https://gerrit.wikimedia.org/r/317027 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaacee30b047f819645ad679eca891eb448bc3da7 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/relevanceForge Gerrit-Branch: master Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits