hrithik18k/open-ring-flex
A flexible wearable PCB integrating inductive battery charging, BLE control with SPI flash and 32 MHz crystal, SAM L10 capacitive touch/wear sensing, haptic MOSFET drive with a large capacitor bank, RF antenna matching, and SWD programming/test connectors.
- Version
- 1.0.4
- License
- CC-BY-NC-SA-4.0
- Stars
- 0
scripts/audit-release.py
import json,hashlib,collections,runpy
from pathlib import Path
a=json.loads(Path('dist/index/circuit.json').read_text())
physical_records=runpy.run_path('scripts/audit-schematic-revision.py')['physical_records']
geometry_hash=hashlib.sha256(json.dumps(sorted(physical_records(a).items())).encode()).hexdigest()
assert geometry_hash==Path('source-data/copper-geometry-baseline.sha256').read_text().strip(), 'PCB geometry changed'
print('PCB geometry unchanged: True (ignoring generated IDs, order and route direction)')
e=[x for x in a if 'error' in x['type']];assert not e,e
p=[x for x in a if x['type']=='source_component' and x.get('supplier_part_numbers') and not x.get('do_not_place')]
print('Purchased component instances:',len(p));assert len(p)==73
print('PCB traces:',sum(x['type']=='pcb_trace' for x in a),'vias:',sum(x['type']=='pcb_via' for x in a))
pcb={x['source_component_id']:x for x in a if x['type']=='pcb_component'}
features=[x for x in a if x['type']=='source_component' and x.get('name','').startswith(('E','PAD','TP'))]
assert all(pcb[x['source_component_id']].get('do_not_place') for x in features)
print('All 14 fabricated electrode/solder/test features excluded from assembly.')