Skip to content

Commit bfb7dc1

Browse files
committed
Generate intersection selection section if we have bookmarks, regardless of selection type
1 parent 63cbee7 commit bfb7dc1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/alttxt/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def add_bullet_points(text: str) -> str:
120120
data_to_write_as_md["UpSet Introduction"] = self.replaceTokens(introduction)
121121
data_to_write_as_md["Dataset Properties"] = self.replaceTokens(dataset_properties)
122122
data_to_write_as_md["Queries and Filters"] = add_bullet_points(self.replaceTokens(query_and_filters))
123-
if self.grammar.selection_type == 'row':
123+
if self.grammar.selection_type == 'row' or len(self.grammar.bookmarked_intersections) > 0:
124124
data_to_write_as_md["Intersection Selection"] = self.replaceTokens(selection_description)
125125
data_to_write_as_md["Set Properties"] = add_bullet_points(self.replaceTokens(set_description))
126126
data_to_write_as_md["Intersection Properties"] = add_bullet_points(self.replaceTokens(intersection_description))

src/alttxt/tokenmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,14 +386,14 @@ def selected_intersection(self) -> str:
386386
for i in range(len(inter.atts)):
387387
result += f"{inter.atts[i]}: {round(inter.att_means[i], 2)}, "
388388
result = result.rstrip(', ') + '.'
389-
else: result = "No intersection is selected."
389+
else: result = "* No intersection is selected."
390390
return result
391391

392392
def bookmark_list(self) -> str:
393393
if len(self.grammar.bookmarked_intersections) > 0:
394394
result = ""
395395
for inter in self.grammar.bookmarked_intersections:
396-
if self.grammar.selected_intersection and inter.id == self.grammar.selected_intersection.id: continue
396+
if self.grammar.selection_type == "row" and self.grammar.selected_intersection and inter.id == self.grammar.selected_intersection.id: continue
397397
result += f"\n* {self.truncate_separately(inter.label)} is bookmarked. Its intersection size is {inter.size}. Its attribute means are: "
398398
for i in range(len(inter.atts)):
399399
result += f"{inter.atts[i]}: {round(inter.att_means[i], 2)}, "

0 commit comments

Comments
 (0)