Skip to content

Commit

Permalink
Group components: no case sensitive
Browse files Browse the repository at this point in the history
See #561
  • Loading branch information
set-soft committed Mar 22, 2024
1 parent 8333165 commit 43fd73f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kicost/edas/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def group_parts(components, fields_merge, c_prjs):
# Don't use the manufacturer's part number when calculating the hash!
# Also, don't use any fields with SEPRTR in the label because that indicates
# a field used by a specific tool (including KiCost).
hash_fields = (fields[k] for k in fields if k not in FIELDS_NOT_HASH and SEPRTR not in k)
hash_fields = (fields[k].lower() for k in fields if k not in FIELDS_NOT_HASH and SEPRTR not in k)
h = hash(tuple(sorted(hash_fields)))

# Now add the hashed component to the group with the matching hash
Expand Down Expand Up @@ -291,7 +291,7 @@ def group_parts(components, fields_merge, c_prjs):
if val is None: # Field with no value...
continue # so ignore it.
if grp_fields.get(key): # This field has been seen before.
if grp_fields[key] != val: # Flag if new field value not the same as old.
if grp_fields[key].lower() != val.lower(): # Flag if new field value not the same as old.
raise KiCostError('Field value mismatch: ref={} field={} value=\'{}\', global=\'{}\' at group={}'
.format(ref, key, val, grp_fields[key], grp.refs), ERR_FIELDS)
else: # First time this field has been seen in the group, so store it.
Expand Down

0 comments on commit 43fd73f

Please sign in to comment.