hildogjr / KiCost

Build cost spreadsheet for a KiCad project.
MIT License
496 stars 97 forks source link

Fix random set sort #436

Closed set-soft closed 3 years ago

set-soft commented 3 years ago

When trying to split groups containing components that looks similar, but have different manf#/distributor# the code uses lists of manf#/distributor# and assumes these lists are corresponding to the order the components has in the group. The problem is that this list turns out to be a set(). These objects are like a dict() that associate each element to True. But dicts doesn't need to keep the order. Some times they do, others don't. This patch changes the set for an OrderedDict. This dict is designed to keep the order. I also changed some uses of the manfcat_codes that I think are wrong or inconsistent.

hildogjr commented 3 years ago

Thanks @set-soft, I hadn't realize this issue.