Skip to content

Commit

Permalink
Use tabulate for slightly nicer output from podio-dump (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener authored Feb 28, 2024
1 parent d12cf45 commit 8243a5d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tools/podio-dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ def print_general_info(reader, filename):
)
print()
print("Frame categories in this file:")
print(f'{"Name":<20} {"Entries":<10}')
print("-" * 31)
for category in reader.categories:
print(f"{category:<20} {len(reader.get(category)):<10}")
print()
cats = [(c, len(reader.get(c))) for c in reader.categories]
print(tabulate(cats, headers=["Name", "Entries"]))


def print_frame_detailed(frame):
Expand Down

0 comments on commit 8243a5d

Please sign in to comment.