Skip to content

Docstring rework for _resolve_wildcards, distilled into a CLAUDE.md guide - #135

Open
nick-gorman wants to merge 2 commits into
translate-network-to-buses-linksfrom
docstring-guide-generic-helpers
Open

Docstring rework for _resolve_wildcards, distilled into a CLAUDE.md guide#135
nick-gorman wants to merge 2 commits into
translate-network-to-buses-linksfrom
docstring-guide-generic-helpers

Conversation

@nick-gorman

@nick-gorman nick-gorman commented Aug 11, 2026

Copy link
Copy Markdown
Member

Follows up Ellie's review feedback on #126 that the _resolve_wildcards docstring was confusing. This PR rewords that docstring, and since the rewording surfaced lessons that seemed transferable, captures them as a new CLAUDE.md section on documenting generic helpers, then tests the guide by getting claude to apply it again to to a similar function, _fuzzy_match_names. Genuinely curious if you think this is a decent improvement across both functions. It's also so pretty verbose so we'd need to watch out it isn't biting too often.

CLAUDE.md                            ← new "Docstrings: generic helpers" section
src/ispypsa/translator/helpers.py    ← _resolve_wildcards docstring reworked per the guide
src/ispypsa/templater/helpers.py     ← the guide applied to _fuzzy_match_names as a second worked example

… guide

Review feedback on #126 found the _resolve_wildcards docstring confusing —
both its structure and its coined terminology (wildcardable, designed
drops). Rewording it produced a set of transferable lessons: established
terminology only, a narrative structure that motivates the input's oddities
before the mechanism, precision about compound cases, and verifying
provenance claims against call sites. These are now captured in CLAUDE.md
as a docstring guide for generic helpers, and demonstrated on a second
function in the same situation, _fuzzy_match_names.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/ispypsa/templater/helpers.py 100.00% <ø> (ø)
src/ispypsa/translator/helpers.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The greedy loop accepts scores at the threshold (>=), not only above it,
and the canonical sub-region names live in mappings.py, not the nodes
table they're used to build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant