Boost test coverage: enable pyoptex in CI and close measured gaps#436
Open
kgdunn wants to merge 11 commits into
Open
Boost test coverage: enable pyoptex in CI and close measured gaps#436kgdunn wants to merge 11 commits into
kgdunn wants to merge 11 commits into
Conversation
Empty commit to open the tracking PR. Upcoming commits add pyoptex to the dev dependency group (with uv override-dependencies to relax its plotly and numba pins), rework the optimal-design fallback tests, add pyoptex-path tests, and close measured coverage gaps in the experiments visualization builders, bivariate elbow/peak, and monitoring control charts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
pyoptex 1.2.1 pins plotly~=5.24 and numba~=0.61, conflicting with the plotting and fast extras. The plotly relaxation is merged upstream but unreleased; numba remains strict upstream. uv override-dependencies matching this project's own floors resolves the conflict for the uv-managed dev environment; the package stays out of published extras so pip metadata remains resolvable. Activates the 8 previously-skipped pyoptex tests (verified passing). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
The fallback and ImportError tests previously ran only when pyoptex was absent, so installing pyoptex in CI would have silently skipped them. A no_pyoptex fixture patches designs_optimal._PYOPTEX_AVAILABLE so both branches run in every environment. Also adds tests for the SEC-19 candidate-set cap and the k+1 budget clamp in the point-exchange fallback. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Covers _convert_factors_to_pyoptex (continuous/categorical mapping, RandomEffect whole-plot grouping and padding), _run_pyoptex model types, metric criteria and metadata, dispatch default budgets, mixed factor types, and the generate_design branch that preserves pyoptex run order. Marks the two import-time no-pyoptex paths with the same pragma style already used for the pyDOE3 guard. designs_optimal.py: 47% -> 100% branch coverage in the pyoptex-enabled environment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Adds a partial_branches section so availability-guard branches whose false side only fires without the optional dependency are not counted as partial. designs_optimal.py now reports 100% branch coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Adds tests for mismatched vector lengths, the more-than-10-values requirement after NaN removal, parallel lines returning (nan, nan), and a known intersection point. _elbow_peak.py: 100% branch coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Adds tests for the non-positive s guard, variants and styles that leave the limits unestimated, the zero-MAD-but-nonconstant warm-up fallback to the standard deviation, and rho/psi boundary behavior. control_charts.py: 100% branch coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Adds 78 tests across 16 test classes for the empty-input placeholders, single-factor guards, constraint annotations, deterministic ridge-trace singularity, steepest-ascent edge paths, box-cox validation, prediction variance hold values, vertex fallbacks in cube/square plots, and factor name inference in the registry. Plots package: 86% -> 99% branch coverage; the two remaining branches are structurally unreachable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Records the pyoptex dev-environment enablement and the expanded coverage tests. CITATION.cff kept in sync with the version and release date. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Full suite now measures 93.81% branch coverage with the pyoptex paths active and the new visualization, bivariate, and monitoring tests; 92 keeps roughly a one-point buffer against platform variation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pyoptex>=1.2.1added to the dev dependency group, with[tool.uv] override-dependencies = ["plotly>=6.5.2", "numba>=0.63.1"]to relax pyoptex's over-strict pins. The plotly relaxation is already merged upstream (mborn1/pyoptex) but not yet released on PyPI; the numba pin is still strict upstream. The overrides match this project's own floors, so nothing else changes. pyoptex stays out of the published extras because pip cannot apply uv overrides, so wheel metadata advertising it would make[expt]+[plotting]unresolvable for pip users.tests/test_designs_optimal_pyoptex.pycovers the adapter layer directly (factor conversion, RandomEffect whole-plot grouping and padding, model types, all three criteria, run-order preservation).designs_optimal.py: 47% to 100% branch coverage. The fallback and ImportError paths intest_designs_screening_optimal.pyare now forced via ano_pyoptexmonkeypatch fixture instead of skip-when-installed markers, so both branches run in every environment; new tests cover the SEC-19 candidate-set cap and budget clamp.bivariate/_elbow_peak.py(100%) andmonitoring/control_charts.py(100%). Full-suite coverage rose from ~89 to 93.81%, and the--cov-fail-undergate is raised 89 to 92.Note for the maintainer: this session does not commit
uv.lockper repo policy; please refresh the lock manually after merge (uv lock). CI relocks on the fly in the interim. Once upstream ships a pyoptex release with the relaxed plotly pin, the plotly override can be dropped; the numba override stays untilnumba~=0.61is relaxed upstream too.Test plan
uv sync --dev --all-extrasresolves with pyoptex 1.2.1, plotly 6.8.0, numba 0.66.0 via the uv overrides_PYOPTEX_AVAILABLE(13 tests)ruff check .andmypy src/process_improveclean locallyChecklist
pyproject.toml(PATCH: 1.51.0 -> 1.51.1, CITATION.cff synced)ruff check .passesCHANGELOG.mdupdated🤖 Generated with Claude Code
https://claude.ai/code/session_012KfWQwqC9Fm3K4eqQ5fzGt