Skip to content

Fix release checks and full-solver optimizer results - #37

Open
RFingAdam wants to merge 4 commits into
mainfrom
fix/release-validation
Open

RFingAdam wants to merge 4 commits into
mainfrom
fix/release-validation

Conversation

@RFingAdam

@RFingAdam RFingAdam commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Fresh installs could select MCP 2, breaking FastMCP imports, and CI omitted GUI dependencies required by type checks and web tests. This consolidates the optimizer fixes from #34 with the dependency correction from #35, installs GUI dependencies in both relevant CI jobs, constrains MCP to its supported major version, and fixes the type errors exposed once dependency resolution succeeds.

Full-solver optimization now returns the full-solver result instead of a CGP-only result that could omit the optimized loss metric. The optimizer also validates its public contract before entering SciPy: variables and targets must be present, bounds must be finite and increasing, target values must be finite, and max_iter must be positive. Regression tests cover the solver result and each invalid-input case.

Validation on Windows and Python 3.11: 636 passed, 12 skipped; ruff, Black, focused mypy, and the prior full repository type, Rust, and documentation checks pass. The earlier coverage run measured 82.26%, above the configured 75% gate and below CONTRIBUTING.md's 90% target. The current head is also checked on Linux, macOS, and Windows with Python 3.11, 3.12, and 3.13.

README installation guidance, validation claims, license wording, and release history now match the checked source and contain no personal checkout path. This PR contains #34's commit and supersedes both #34 and #35.

RFingAdam and others added 4 commits September 3, 2026 20:47
…dity

Two defects that made target_z0 fail on differential geometries and return
negative impedances on wide asymmetric striplines.

stripline_asymmetric used the IPC-2141A logarithmic form unguarded. That
form is only valid while 8*H_eff/(0.67*pi*(0.8W+T)) > 1; as W grows the
argument falls below 1, the log goes negative, and Z0, L_per_m and C_per_m
all come back negative. The TLineResult validators then rejected the
result, so a caller saw a confusing Pydantic error rather than "this trace
is too wide for this cavity", and the final re-solve in target_z0 died
outright. Raise a descriptive domain error naming the validity limit and
the widest W that satisfies it. The message is ASCII-only: it is raised on
paths that may be printed to a cp1252 console, where a non-ASCII character
would raise a second exception while reporting the first.

target_z0 hardcoded target={"z0": ...}, but a differential solve returns a
DiffResult carrying z_odd/z_even/z_diff/z_common and no z0 at all. Every
candidate therefore missed, the objective returned its 1e6 penalty
everywhere, the cost surface was perfectly flat, and the bounded search
parked at an arbitrary endpoint -- reporting success=False with a null
impedance instead of the actual problem, which is that the requested metric
does not exist for that geometry. Probe-solve the template once and pick
the metric it reports; accept an explicit metric= override.

Fixing the validity guard then exposed a second-order weakness. With wide W
now correctly refused, a default 0.1-100 mil bound can leave the feasible
region confined to the bottom fraction of the interval, and golden-section
samples only the flat penalty slab -- never touching a solvable geometry.
Added a 64-point log-spaced feasibility pre-scan to bracket the search, and
track the best evaluable candidate so the result no longer depends on where
the optimizer happens to stop. optimize_for now raises when nothing inside
the bounds is evaluable, rather than returning a bogus success=False.

Also replaces a docstring example that carried provenance from a specific
design with a neutral worked example.

Tests: 549 passed, 12 skipped (tests/test_web excluded -- needs the `gui`
extra, unrelated to this change).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@RFingAdam
RFingAdam marked this pull request as ready for review September 10, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant