Fix solver correctness and input-validation issues from code review
- Refuse the uniform contact model when the fills form multiple disconnected copper groups that each touch both terminals: the prescribed injection split is ill-posed and the grounded system was singular, silently returning garbage (e.g. negative gigaohms). connected_restrict now reports the component count; a power-balance backstop (SolverError) catches any other inconsistent solve. - Connect via/pad barrels to the nearest fill copper within the pad footprint (+1 cell) instead of only the exact center cell, so thermal-relief spokes still stitch layers; barrels that reach fill on fewer than two layers are warned about. ViaLink gains pad_nm (extracted from the padstack, JSON-roundtripped). - Validate dialog input on OK (layers, current > 0, cell > 0, parseable frequency, extra Cu >= 0) with an inline error instead of silently substituting defaults; parse_frequency raises on garbage; pipeline rejects i_test <= 0; choose_cell_size rejects non-positive overrides. - Warn when a contact part is dropped by the connectivity restriction; floor instead of truncate in cell_of; correct the uniform-model summary line; drop an unused variable; refresh plugin.json wording. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,7 @@ def test_problem_json_roundtrip_v2(tmp_path):
|
||||
[([(0, 0), (10, 0), (10, 1), (0, 1)], [])]],
|
||||
rect1_mm=(0, 0, 1, 1), rect2_mm=(9, 0, 10, 1),
|
||||
contact1="L0", contact2="L1", vias_mm=[(5.5, 0.5)])
|
||||
p.vias[0].pad_nm = 600_000
|
||||
f = tmp_path / "dump.json"
|
||||
save_problem(p, f)
|
||||
q = load_problem(f)
|
||||
@@ -58,6 +59,7 @@ def test_problem_json_roundtrip_v2(tmp_path):
|
||||
assert q.electrodes1[0].contact == "L0"
|
||||
assert q.electrodes2[0].contact == "L1"
|
||||
assert len(q.vias) == 1 and q.vias[0].drill_nm == p.vias[0].drill_nm
|
||||
assert q.vias[0].pad_nm == 600_000
|
||||
assert q.plating_nm == p.plating_nm
|
||||
assert np.array_equal(q.layers[0].polygons[0].outline,
|
||||
p.layers[0].polygons[0].outline)
|
||||
|
||||
Reference in New Issue
Block a user