Merge pull request 'dd/upgrade_bom_gen' () from dd/upgrade_bom_gen into main

Reviewed-on: https://staging.allspice.dev/AllSpice-Demos/Actions-demo/pulls/33
This commit is contained in:
AllSpiceUser 2024-06-24 21:40:03 +00:00
commit ab03c255f4
3 changed files with 28 additions and 6 deletions

16
.allspice/columns.yml Normal file
View File

@ -0,0 +1,16 @@
columns:
- name: "Manufacturer"
part_attributes:
- "Manufacturer"
- "MANUFACTURER"
- name: "Part Number"
part_attributes:
- "PART"
- "MANUFACTURER #"
- "_part_id"
- name: "Designator"
part_attributes: "Designator"
- name: "Description"
part_attributes:
- "PART DESCRIPTION"
- "_description"

View File

@ -98,7 +98,13 @@ if __name__ == "__main__":
for net in nets:
writer.write(net + "\n")
pins_on_net = netlist_rows[net]
pins_on_net.sort()
try:
# Convert to list if it's not already, and then sort
if not isinstance(pins_on_net, list):
pins_on_net = list(pins_on_net)
pins_on_net.sort()
except Exception as e:
print(f"Error sorting pins on net {net}: {e}", file=sys.stderr)
writer.write(" " + " ".join(pins_on_net) + "\n")
print("Generated PCB netlist.", file=sys.stderr)
print("Generated PCB netlist.", file=sys.stderr)

View File

@ -17,14 +17,14 @@ jobs:
uses: actions/checkout@v3
- name: Generate BOM
uses: https://hub.allspice.io/Actions/generate-bom@v0.3
uses: https://hub.allspice.io/Actions/generate-bom@v0.4
with:
# The path to the project file in your repo (.PrjPcb for Altium, .DSN for OrCad).
source_path: Archimajor.PrjPcb
# [optional] A path to a JSON file mapping columns to the component attributes
# they are from. This file must be provided.
# [optional] A path to a YAML file mapping columns to the component attributes
# This file must be provided.
# Default: 'columns.json'
columns: .allspice/columns.json
columns: .allspice/columns.yml
# [optional] The path to the output file that will be generated.
# Default: 'bom.csv'
output_file_name: bom.csv