@@ -535,9 +535,11 @@ def html_table(rows, *, header):
535535
536536
537537def metadata_details (table ):
538- size = naturalsize (len (table .metadata ))
539538 schema = table .metadata_schema .schema
540- return size + ("" if schema is None else f" ({ schema ['codec' ]} )" )
539+ if len (table .metadata ) == 0 and schema is None :
540+ return ""
541+ size = f"({ len (table .metadata ) / table .nbytes :.1%} )"
542+ return ("" if schema is None else f"{ schema ['codec' ]} " ) + size
541543
542544
543545def tree_sequence_html (ts ):
@@ -547,11 +549,9 @@ def tree_sequence_html(ts):
547549 <td>{ name .capitalize ()} </td>
548550 <td>{ format_number (table .num_rows )} </td>
549551 <td>{ naturalsize (table .nbytes )} </td>
550- <td style="text-align: center;">
551- { metadata_details (table )
552- if hasattr (table , "metadata" ) and len (table .metadata ) > 0
553- else '' }
554- </td>
552+ <td style="text-align: center;">{ metadata_details (table )
553+ if hasattr (table , "metadata" )
554+ else "" } </td>
555555 </tr>
556556 """
557557 for name , table in ts .tables .table_name_map .items ()
@@ -644,7 +644,7 @@ def tree_sequence_html(ts):
644644 <th style="line-height:21px;">Table</th>
645645 <th>Rows</th>
646646 <th>Size</th>
647- <th>Metadata</th>
647+ <th>Metadata (size) </th>
648648 </tr>
649649 </thead>
650650 <tbody>
0 commit comments