Skip to content

Fix undefined in readable netlists and improve pin labels#23

Open
ysdy823 wants to merge 1 commit intotscircuit:mainfrom
ysdy823:fix/undefined-and-pin-labels
Open

Fix undefined in readable netlists and improve pin labels#23
ysdy823 wants to merge 1 commit intotscircuit:mainfrom
ysdy823:fix/undefined-and-pin-labels

Conversation

@ysdy823
Copy link
Copy Markdown

@ysdy823 ysdy823 commented Mar 28, 2026

Summary

  • Fix scorePhrase to check word quality list before digit regex, so labels like "GPIO1" score 1.1 (matching "GPIO") instead of 0.5, and appear in pin descriptions
  • Lower pin label inclusion threshold from > 1 to >= 1 so custom pin names are included
  • Handle undefined footprint in COMPONENT_PINS header (was showing "1kΩ undefined" when no footprint)
  • Handle undefined port.name fallback in COMPONENT_PINS mainPin and in getReadableNameForPin
  • Handle empty possibleNames array in generateNetName to prevent crash

Closes #4

Test plan

  • All 3 existing tests pass with no snapshot changes
  • Verify on circuit with many pins (e.g. pico-w) that pin labels now show full names like "GPIO1" instead of just "pin14"
  • Verify no "undefined" text appears in netlist output for components without footprints

🤖 Generated with Claude Code

…ation

- Fix scorePhrase to check word quality list before digit regex, so labels
  like "GPIO1" score 1.1 instead of 0.5 and appear in pin descriptions
- Lower pin label threshold from > 1 to >= 1 to include custom pin names
- Handle undefined footprint in COMPONENT_PINS header using filter(Boolean)
- Handle undefined port.name fallback in COMPONENT_PINS mainPin
- Handle undefined port.name and port.pin_number in getReadableNameForPin
- Handle empty possibleNames array in generateNetName

Closes tscircuit#4

Co-Authored-By: Claude Opus 4.6 (1M context) <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.

Undefined in readable netlists, pin labels are too short, just "pin14" instead of full pin labels

1 participant