Skip to content

Commit

Permalink
Minor bugfix in filtering labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav committed Nov 4, 2024
1 parent 8260e60 commit 98ccab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/babel_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,11 @@ def write_compendium(synonym_list,ofname,node_type,labels={},extra_prefixes=[],i

# Step 3. Filter out labels longer than config['demote_labels_longer_than'], but only if there is at
# least one label shorter than this limit.
labels_shorter_than_limit = [l for l in possible_labels if l and len(l) <= config['demote_labels_longer_than']]
labels_shorter_than_limit = [l for l in filtered_possible_labels if l and len(l) <= config['demote_labels_longer_than']]
if labels_shorter_than_limit:
filtered_possible_labels = labels_shorter_than_limit

# Step 4. Pick the first label that isn't blank.
# Step 4. Pick the first label if it isn't blank.
if filtered_possible_labels:
preferred_name = filtered_possible_labels[0]
else:
Expand Down

0 comments on commit 98ccab5

Please sign in to comment.