Closed zarino closed 1 year ago
Okay! So I've got some commits in there that make the keyphrase comparison functional.
My bigger thoughts:
Also the possibly unbound twin variable was bugging me because I couldn't think of a better way to do it, it turns out you can use next to grab the first one, or None if there's nothing:
twin = next(
(
group["councils"][0]
for group in related_councils
if group["type"].slug == "composite"
),
None,
)
if twin in None:
raise ValueError("No valid twin, no similar composite councils calculated")
Won't change myself because it's not necessarily more readable.
Fixes #530.
TODO: