Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Council climate twins page #531

Merged
merged 6 commits into from
Jun 28, 2023
Merged

[WIP] Council climate twins page #531

merged 6 commits into from
Jun 28, 2023

Conversation

zarino
Copy link
Member

@zarino zarino commented Jun 21, 2023

Fixes #530.

TODO:

  • Working semantic topic extraction
  • Working public opinion data
  • Detailed data in the “extended family” table

Screenshot 2023-06-23 at 16-18-46 Liverpool City Council’s climate twin

@zarino zarino force-pushed the 530-council-climate-twins branch 2 times, most recently from cdff1da to fae815a Compare June 23, 2023 15:18
@ajparsons
Copy link
Contributor

Okay! So I've got some commits in there that make the keyphrase comparison functional.

My bigger thoughts:

  • I think you want to go wider that just 'one' twin. This is quite easy to adapt wider, and you could have the related text at the bottom link to alternative views.
  • The big reason for this is the nearest 'twin' might not be surprising, and so might not be that informative. But being able to see more info on differences across a range (as you do at the bottom) might be!
  • Along with that, 'twin' language might need to change.
  • For technical reasons, the polling isn't good for a comparison. Core reason is these technically have error margins, but I don't know them, and so small differencesmay not be statistically significant. Because MRP polling uses demographics to create local results, and similarity is calculated in ways that might reflect similar demographics, it is likely that most 'twin' councils will have similar polling results, and in turn that that difference is meaningless.

@ajparsons
Copy link
Contributor

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.

zarino and others added 6 commits June 28, 2023 15:19
- Add functions to PlanDocument and Council
  to find overlaps and intersections between
  sets of documents belonging to different councils.
- Rather than the count, use the badges
Includes new convenience methods on the Council model, to fetch
related EmergencyDeclarations, Promises, and PlanDocuments. I figured
it was about time we did this! Would be nice to re-use these methods
on the main Council pages, now, as well as the API.
@zarino zarino force-pushed the 530-council-climate-twins branch from 89474ff to 3619007 Compare June 28, 2023 15:02
@zarino zarino merged commit 3619007 into master Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create experimental “find your council twin” interface
2 participants