Repository navigation
fix(connector): a county asks which of its districts - #240
Draft
billlyzhaoyh wants to merge 1 commit into
Draft
billlyzhaoyh wants to merge 1 commit into
billlyzhaoyh wants to merge 1 commit into
Conversation
describe_place describes one council at a time. Given a county's name, it fell back to matching part of a council's name, so "Gloucestershire" was found as South Gloucestershire, a different council, "Hampshire" as East Hampshire, one of its districts, and "Kent" was not found. Each of England's 21 counties with two tiers of council is now in the table of areas larger than one council that London is in, so its name answers choose and lists all its districts. The districts come from the county lookup the package ships, so no list is kept by hand and none is cut to the usual 10. "Kent County Council" is matched as "Kent". The choose message now says the area is split into that many local authorities: a county also has its own council, so "has 6 councils" was wrong for Gloucestershire. Unchanged: a district, a unitary council and London are found as before. Older county names, such as Berkshire, are not in the lookup and still find a council whose name holds them. Signed-off-by: billlyzhaoyh <billlyzhaoyh@users.noreply.github.com> Github-Issue: #236
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #236.
The problem
The connector's
describe_place, which the chat assistant uses, describes one council at a time. Given a county's name, it fell back to matching part of a council's name, so the answer depended on which district names happened to hold the county's:The fix
A county is now answered as London is (#234):
choose, listing all its districts.areas.local_authority_lookup("county")), so no list is kept by hand. As with London, the list is complete and isn't cut to the usual 10: Essex, Kent and Lancashire have 12 each.Nothing public changes.
Tests
test_a_county_asks_which_of_its_districtschecks that "Gloucestershire" lists its 6 districts, and not South Gloucestershire.ruff checkruff format --checkast-grep scanty check srcpytest(1,296 passed)mkdocs build --strictchoosewith all its districts, from Cambridgeshire (5) to Worcestershire (6). "London" still lists 33. "City of London", "Hackney", "South Gloucestershire", "East Hampshire", "Cornwall" and "North Yorkshire" are found.-m live). Nothing here reads a new source.Found in review, not changed here
not_found. That's honest, and the issue is about names.AI tools
Claude Code wrote the change, the test and this description, and ran the code review and simplify passes.