-
Notifications
You must be signed in to change notification settings - Fork 175
Conversation
It turns out this was actually already supported, but with a different name and we have agreed on new terminology (pointhi#586 (comment))
Code Climate has analyzed commit a701822 and detected 0 issues on this pull request. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just an initial reading over the code.
I have yet to use and understand scripts/tools/custom_pad_layout.py
.
I hope to get a full review done on the weekend.
scripts/Packages/Package_Gullwing__QFP_SOIC_SO/ipc_gullwing_generator.py
Outdated
Show resolved
Hide resolved
scripts/Packages/Package_Gullwing__QFP_SOIC_SO/ipc_gullwing_generator.py
Show resolved
Hide resolved
scripts/Packages/Package_Gullwing__QFP_SOIC_SO/size_definitions/test_hidden_deleted_pins.yaml
Show resolved
Hide resolved
scripts/Packages/Package_Gullwing__QFP_SOIC_SO/size_definitions/test_hidden_deleted_pins.yaml
Outdated
Show resolved
Hide resolved
j = init # pad number for deleted pins | ||
|
||
if kwargs.get("deleted_pins"): | ||
skip_pins = kwargs["deleted_pins"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't like this naming. I think the variable should be called deleted_pins
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to abstract things. In the PadArray node, for example, I kept the exclude_pin_list variable name but I allow two entry points of hidden_pins and deleted_pins since there are some cases where the same list works and other places where I need to know if the pins are hidden or deleted. Similarly, I decided to use a general term under the hood that could be used for other purposes in the future while the parameter name is specific to the behavior the user requests. .I can change it if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about that:
def increment(pincount, init=1, skip_pins=[]):
That makes it more abstract, it does not need to know about the deleted_pins
keyword.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, but I will still have to pick this keyword up in get_generator()
so I figured it was essentially the same thing one place or the other. Is it better to grab this keyword in one place or the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to extract the keyword in the calling function.
That way the increment
is more abstract. Also the user/programmer can clearly see what it does when looking at the arguments.
edit I now also looked at the get_generator()
function and it suffers from the same problem. It just gets passed a dictionary of arguments. It is virtually impossible to see which keys are needed.
I prefer the style when functions are called with named parameters so one can clearly see what is happening. Like so
But that would require substabtial refactoring when looking at the generators. Thus, your argument that it does not really matter where the keyword is processed is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I was feeling. Sorry for not being more clear and/or verbose. I originally had the pin-skipping increment generator as a separate function but decided from the outside it was similar enough to just combine them. I'll leave this alone unless I hear another comment from you.
Edit: And I agree with you, but I figured 'fitting in' with the code style was best here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, custom pad numbering doesn't work with deleted pins. If that's going to work in the future the refactoring will need to be done since the pins to be deleted will have to be removed for any generator function and not just the increment one. But that can happen when/if needed.
@cpresser |
- Reuse variable where possible - Replace datasheet links with tilde - Correct SOT-23-6 custom FP name - Improve increment pin number generator description
The node |
I did play around with the generator a little and don't quite understand the need for The SOT-23 can also be build with: # can we do a SOT-23 without the custom_pad_layout? Seems like that is a yes!
SOT-23:
size_source: '~'
custom_name_format: 'SOT-23'
body_size_x: 1.6
body_size_y: 2.9
overall_size_x: 2.8
lead_width: 0.3 .. 0.5
lead_len: 0.3 .. 0.45 .. 0.6
pitch: 0.95
num_pins_x: 0
num_pins_y: 3
deleted_pins: [2, 4 ,6] It seems to identical to the one you build with the custom layout. |
I took a short look at How about returning if number == None:
continue after line 244? |
Something is now broken when using deleted_pins. Let me sort this out and then I'll commit with the changes I described above, and also reply to your last two comments about the SOT-23 footprint and PadArray. Hang on... |
- Also fixed a typo on line 55 of the test YAML file
Sorry about the delay. I didn't have as much time as I expected to work on this the last couple days. I had it figured out everything with deleted pins before and then forgot what I was doing. I've added more comments now to hopefully help me and everybody else who (sadly) has to deal with my ineptitude. Good call on the SOT-23. I felt stuck on the deleted pins so I did the custom pad layout for SOT-23. Once the deleted pins was working I didn't realize the deleted pins meant the one custom pad layout wasn't necessary. Thanks! I didn't remove the custom pad layout file, yet, so please confirm and then I'll remove it in another commit and clean up the YAML file. We are thinking similarly about filtering out pads that are deleted. I did it slightly differently so that it handles any other disallowed type for a pad number. Anything else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked you recent commits and skimmed through all changes.
Looks good! ❤️
Just one import that you missed.
scripts/Packages/Package_Gullwing__QFP_SOIC_SO/ipc_gullwing_generator.py
Outdated
Show resolved
Hide resolved
@cpresser |
Tbh, I would need to look at that again in detail. But the overall idea sounds promising. PadArray should be as agnostic as possible. Feel free to rework this, I will gladly review it. |
@evanshultz @evanshultz #645 (comment) |
No. Well, yes. If a standard footprint name is used, which is built inside the script, the pincount is always changed to a string so it works. But I didn't think about custom footprint names. Do you want me to push a fix? |
Yes, please. |
It was a positive integer until we adopted the IPC naming format for deleted and hidden pins. I think it's the right way to go, but I had overlooked custom footprint names. I submitted #649, which I think should take care of things. |
As discussed at #586 and specifically at #586 (comment), I've added support for deleted pins (pins which are not present but do not consume a pin number) and custom pad layouts like SOT23.
Here are some example footprints (from test_hidden_deleted_pins.yaml):
I had to change scripts/Packages/Package_Gullwing__QFP_SOIC_SO/size_definitions/soic.yaml just to conform to this new terminology.
@pointhi
The node PadArray seems to barely resemble the original implementation. There are so many caveats with deleted and hidden pins now. Since the values were being validated already, I chose to use a negative number as a filter since negative pin numbers seemed like they should not be allowed. Are you OK with this or do you have some other direction you'd like to pursue?