Skip to content

Conversation

@meesokim
Copy link

The changes fix a critical bug in the rmv_pins() method:

Three main issues were resolved:

Variable name error: del pins[i] → del self.pins[i] (the variable pins didn't exist)
Logic error: Changed from in operator to exact equality (==)
Before: pin.num in pin_ids would match incorrectly
After: pin.num == pin_id checks for exact matches
Loop structure: Reorganized to iterate over pin_ids first, then search through pins for better predictability

The changes fix a critical bug in the rmv_pins() method:

Three main issues were resolved:

Variable name error: del pins[i] → del self.pins[i] (the variable pins didn't exist)
Logic error: Changed from in operator to exact equality (==)
Before: pin.num in pin_ids would match incorrectly
After: pin.num == pin_id checks for exact matches
Loop structure: Reorganized to iterate over pin_ids first, then search through pins for better predictability
@devbisme
Copy link
Owner

devbisme commented Nov 26, 2025

Thanks for the bug report!

Before: pin.num in pin_ids would match incorrectly

Is there a unit test that demonstrates this problem? (The current unit tests obviously don't.)

Updated repository URLs in
setup.py
 to point to meesokim/skidl. Creating installation guide.
@meesokim
Copy link
Author

meesokim commented Dec 1, 2025

class Connector(Part):
def init(self, args, **kwargs):
super().init(ref_prefix='C', **kwargs)
self.rmv_pins(
[i for i in range(1,31)])
gpios = [f'GPIO{i}' for i in range(21)]
gpios.extend(['3V3', 'GND', '5V'])
gpios.extend([f'GPIO{i}' for i in range(21,27)])
for ix, gpio in enumerate(gpios):
self += Pin(num=ix+1, name=gpio)

connector = Connector(lib='Connector_Generic', name='Conn_01x30', footprint='Connector_PinSocket_2.54mm:PinSocket_1x30_P2.54mm_Horizontal')

if type(pin.num) == str, pin.num == str(pin_id) should be modified in the source

@meesokim
Copy link
Author

meesokim commented Dec 1, 2025

is there any function for renaming pins? Also generate_schematic doesn't apply the modified pin names.

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.

2 participants