Closed craigarno closed 1 year ago
This problem may have been a result of a part number which includes a ',' in the part number
NZH10C,115 https://www.digikey.com/en/products/detail/rochester-electronics-llc/NZH10C-115/15641970 https://www.mouser.com/ProductDetail/Nexperia/NZH10C115?qs=5DYmZrWuUEoyHVRX7wWPEg%3D%3D https://www.arrow.com/en/products/nzh10c115/nexperia?region=nac&utm_currency=USD&utm_keyword=NZH10C,115 https://www.lcsc.com/product-detail/Zener-Diodes_Nexperia-NZH10C-115_C551630.html https://www.tme.eu/en/details/nzh10c.115/smd-zener-diodes/nexperia/nzh10c-115/
When I escape the comma in the part number like this: NZH10C\,115 Nexar doesn't crash.
The clue was in the Spreadsheet, two entries for part D3 as KiCost tried to parse the partnumber two separate numbers. Escaping the comma allowed the entire number to be used in lookup.
I propose that parsing of the number field should happen in KiCost and commas escaped before submitting to all vendors; Digikey, Mouser, Nexar, Newark, TME, etc.
I wonder if different/improved error handling could also prevent this sort of crash?
Hi @craigarno ! Try the above patch. The problem seems to be in the difflib returning 0 best matches. Now the code should take the first match if none is better than the others.
Normal run, seems a list index is exceeding whatever value it is set in the Nexar API
Issue / Problem report
Add the KiCost version. Type
kicost --version
at terminal.Add a terminal error report / txt, use
--debug
option on KiCost call; kicost -w -i %YOUR_FILE% --debug 8Write the command used to call KiCost (or the graphical interface configuration); kicost -w -i "usbc-cypd3177-24lqxq.xml" --eda kicad
One BoM to reproduce the error (with the EDA version).