Skip to content

Commit

Permalink
fixed check for labels in summary()
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeckstASU committed May 29, 2024
1 parent 0f5f5e6 commit f809263
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions mdgeom/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def summary(*universes, labels=None):
Parameters
----------
universes : list of Universe
universes : Universe
Print information about these simulation systems
in a table.
Expand Down Expand Up @@ -49,17 +49,18 @@ def summary(*universes, labels=None):
"dt/ps",
]

if labels is None:
labels = len(universes) * [None]
column_names = data_column_names
else:
column_names = ["simulation"] + data_column_names

if len(labels) != len(universes):
raise ValueError(
f"labels {labels} must contain one "
f"label per universe {universes}"
)

if labels is None:
labels = len(universes) * [None]
column_names = data_column_names
else:
column_names = ["simulation"] + data_column_names

table = prettytable.PrettyTable()
table.field_names = column_names
Expand Down

0 comments on commit f809263

Please sign in to comment.