Skip to content

Commit f1d8acc

Browse files
authored
Merge pull request #664 from mdekstrand/fix/many-warnings
Only warn once for users with missing test items in analysis
2 parents 4e50da7 + 25cbf10 commit f1d8acc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lenskit/metrics/bulk.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,14 @@ def measure(
250250

251251
n = len(outputs)
252252
_log.info("computing %d listwise metrics for %d output lists", len(lms), n)
253+
no_test_count = 0
253254
with item_progress("Measuring", n) as pb:
254255
for i, (key, out) in enumerate(outputs):
255256
list_test = test.lookup_projected(key)
256257
if out is None:
257258
pass
258259
elif list_test is None:
259-
_log.warning("list %s: no test items", key)
260+
no_test_count += 1
260261
else:
261262
l_row: list[float | None] = []
262263
for m in lms:
@@ -272,6 +273,9 @@ def measure(
272273
list_results.iloc[i] = l_row # type: ignore
273274
pb.update()
274275

276+
if no_test_count:
277+
_log.warning("could not find test data for %d lists", no_test_count)
278+
275279
_log.info("computing %d global metrics for %d output lists", len(gms), n)
276280
global_results = pd.Series(
277281
{

0 commit comments

Comments
 (0)