diff --git a/kibom/netlist_reader.py b/kibom/netlist_reader.py index 328c278..38ac041 100644 --- a/kibom/netlist_reader.py +++ b/kibom/netlist_reader.py @@ -12,6 +12,7 @@ import sys import os.path import xml.sax as sax +from natsort import natsorted from .component import Component, ComponentGroup from .preferences import BomPref @@ -358,7 +359,7 @@ def groupComponents(self, components): # Sort the groups # First priority is the Type of component (e.g. R?, U?, L?) - groups = sorted(groups, key=lambda g: [g.components[0].getPrefix(), g.components[0].getValueSort()]) + groups = natsorted(groups, key=lambda g: [g.components[0].getRef(), g.components[0].getValueSort()]) return groups