Skip to content

Commit

Permalink
Only show when column is present in df
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Feb 15, 2024
1 parent 2ef0559 commit 8c75b32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/haddock/libs/libplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ def _generate_unclustered_table_html(
{ 'key': "caprieval_rank", 'label': "Structure Rank", 'sorted': "asc" },
{ 'key': "model", 'label': "Structure", 'sortable': False, 'type': "structure" },
] + [
{'key': k, 'label': v, 'type': 'stats'} for k, v in AXIS_NAMES.items()
{'key': k, 'label': v, 'type': 'stats'} for k, v in AXIS_NAMES.items() if k in df.columns
] + [
{ 'key': "id", 'label': "Structure ID" },
]
Expand Down Expand Up @@ -967,7 +967,7 @@ def _generate_clustered_table_html(
{ 'key': "cluster_id", 'label': "Cluster ID" },
{ 'key': "n", 'label': "Cluster size" },
] + [
{'key': k, 'label': v, 'type': 'stats'} for k, v in AXIS_NAMES.items()
{'key': k, 'label': v, 'type': 'stats'} for k, v in AXIS_NAMES.items() if k in df.columns
] + [
{ 'key': f"best{i}", 'label': f"Nr {i} best structure", 'sortable': False, 'type': "structure" } for i in range(1, nr_best_columns + 1)
]
Expand Down

0 comments on commit 8c75b32

Please sign in to comment.