Adapt Pinscope to DeepSeek, auto datasheets, and a shared library.
Based on manvalan/pinscope main. Default LLM is DeepSeek with local skills and PDF ingest. Datasheets are fetched from LCSC/TI, stored in the component library, and review extracts abs-max with a deeper checklist. Adds scripts/update-pinscope.sh for the production host.
This commit is contained in:
@@ -41,7 +41,18 @@ Decode the MPN and package details into a single `PackageInfo`:
|
||||
|
||||
Look for an "Ordering Information" or "Device Information" table in the datasheet — most datasheets have one.
|
||||
|
||||
### 4. Assign component subtype (taxonomy)
|
||||
### 4. Extract absolute maximum ratings
|
||||
|
||||
Copy the **Absolute Maximum Ratings** table (not Recommended Operating Conditions). For each row that a reviewer would need to compare against the schematic rails:
|
||||
|
||||
- `parameter` (str) — as printed (`VCC`, `VIN`, `I/O pin voltage`, `Storage temperature`, …)
|
||||
- `min` / `max` (number or null) — numeric limit; omit the other side if the table only lists one
|
||||
- `unit` (str) — `V`, `mA`, `°C`, …
|
||||
- `source_page` (int) — 1-based datasheet page of that row
|
||||
|
||||
Include supply voltages, pin/input voltages, input current, and temperature. Skip ESD human-body-model rows unless they are the only voltage limit given. Do not invent numbers; if the table is a raster with no readable values, return an empty array.
|
||||
|
||||
### 5. Assign component subtype (taxonomy)
|
||||
|
||||
The existing IC taxonomy subtypes are provided in the system prompt under `EXISTING IC TAXONOMY SUBTYPES`. Pick the best matching subtype based on the component's MPN, package info, and pin names.
|
||||
|
||||
@@ -49,7 +60,7 @@ If no existing subtype fits, propose a new one following the dot-notation conven
|
||||
|
||||
Set the chosen subtype on the `component_subtype` field.
|
||||
|
||||
### 5. Quality checks
|
||||
### 6. Quality checks
|
||||
|
||||
Before producing output, verify:
|
||||
- Pin count matches what the datasheet says for this package
|
||||
@@ -57,7 +68,7 @@ Before producing output, verify:
|
||||
- No pins are missing (compare against the datasheet's stated pin count)
|
||||
- Pin names look reasonable (not garbled OCR artifacts)
|
||||
|
||||
### 6. Validate and output
|
||||
### 7. Validate and output
|
||||
|
||||
Validate your extraction against the output schema:
|
||||
|
||||
|
||||
@@ -30,6 +30,20 @@
|
||||
},
|
||||
"required": ["number", "name"]
|
||||
}
|
||||
},
|
||||
"absolute_maximum_ratings": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"parameter": {"type": "string"},
|
||||
"min": {"type": ["number", "null"]},
|
||||
"max": {"type": ["number", "null"]},
|
||||
"unit": {"type": "string"},
|
||||
"source_page": {"type": "integer"}
|
||||
},
|
||||
"required": ["parameter", "unit", "source_page"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["component_subtype", "package_info", "pintable"]
|
||||
|
||||
@@ -47,6 +47,21 @@ def validate(data: dict) -> list[str]:
|
||||
if dupes:
|
||||
errors.append(f"Duplicate pin numbers: {dupes}")
|
||||
|
||||
if "absolute_maximum_ratings" in data:
|
||||
ratings = data["absolute_maximum_ratings"]
|
||||
if ratings is not None and not isinstance(ratings, list):
|
||||
errors.append("absolute_maximum_ratings must be an array")
|
||||
elif isinstance(ratings, list):
|
||||
for i, row in enumerate(ratings):
|
||||
if not isinstance(row, dict):
|
||||
errors.append(f"absolute_maximum_ratings[{i}] must be an object")
|
||||
continue
|
||||
for f in ("parameter", "unit", "source_page"):
|
||||
if f not in row:
|
||||
errors.append(
|
||||
f"absolute_maximum_ratings[{i}] missing required field: {f}"
|
||||
)
|
||||
|
||||
return errors
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user