Skip to content

Commit 42defc6

Browse files
committed
cli: minor printing when combining
1 parent d213724 commit 42defc6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/negmas/tournaments/tournaments.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2299,12 +2299,16 @@ def combine_tournament_stats(
22992299
for filename in src.glob(f"**/{STATS_FILE}"):
23002300
# try:
23012301
if verbose:
2302-
print(f"[{added + 1}] Stats from {filename}", end="", flush=True)
2302+
print(f"[{added + 1}] Stats from {filename} ", end="", flush=True)
23032303
data = extract_basic_stats(filename)
23042304
if data is None:
23052305
if verbose:
23062306
print("No data found")
23072307
continue
2308+
if len(data) == 0:
2309+
if verbose:
2310+
print("Zero records found")
2311+
continue
23082312
if verbose:
23092313
print("{len(data)} records")
23102314
added += 1
@@ -2377,9 +2381,14 @@ def combine_tournament_results(
23772381
for filename in src.glob("**/scores.csv"):
23782382
try:
23792383
data = pd.read_csv(filename)
2380-
scores.append(data)
2384+
23812385
if verbose:
2382-
print(f"[{added + 1}] Read: {str(filename)} ({len(data)} records)")
2386+
print(f"[{added + 1}] Read: {str(filename)} ", end="", flush=True)
2387+
if data is None or len(data) == 0:
2388+
print("No data found")
2389+
continue
2390+
scores.append(data)
2391+
print(f"{len(data)} records")
23832392
added += 1
23842393
if added >= max_sources:
23852394
break

0 commit comments

Comments
 (0)