Skip to content

Commit d213724

Browse files
committed
cli: better printing when combining results
1 parent b3f1af6 commit d213724

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/negmas/tournaments/tournaments.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,7 @@ def combine_tournament_stats(
23062306
print("No data found")
23072307
continue
23082308
if verbose:
2309-
print("")
2309+
print("{len(data)} records")
23102310
added += 1
23112311
if added >= max_sources:
23122312
break
@@ -2376,9 +2376,10 @@ def combine_tournament_results(
23762376
src = _path(src)
23772377
for filename in src.glob("**/scores.csv"):
23782378
try:
2379-
scores.append(pd.read_csv(filename))
2379+
data = pd.read_csv(filename)
2380+
scores.append(data)
23802381
if verbose:
2381-
print(f"[{added + 1}] Read: {str(filename)}")
2382+
print(f"[{added + 1}] Read: {str(filename)} ({len(data)} records)")
23822383
added += 1
23832384
if added >= max_sources:
23842385
break
@@ -2392,6 +2393,8 @@ def combine_tournament_results(
23922393
print("No scores found")
23932394
return pd.DataFrame()
23942395
df: pd.DataFrame = pd.concat(scores, axis=0, ignore_index=True, sort=True)
2396+
if verbose:
2397+
print(f"Read a total of {len(df)} score records")
23952398
if dest is not None:
23962399
df.to_csv(str(_path(dest) / SCORES_FILE), index=False)
23972400
return df

0 commit comments

Comments
 (0)