Skip to content

Boost pyoptex optimal-design test coverage + reliance assessment#415

Open
kgdunn wants to merge 5 commits into
mainfrom
claude/pyoptex-test-coverage-fbcne2
Open

Boost pyoptex optimal-design test coverage + reliance assessment#415
kgdunn wants to merge 5 commits into
mainfrom
claude/pyoptex-test-coverage-fbcne2

Conversation

@kgdunn

@kgdunn kgdunn commented Jun 12, 2026

Copy link
Copy Markdown
Owner

What and why

The optimal-design code (experiments/designs_optimal.py) integrates the optional pyoptex library for D/I/A-optimal and split-plot designs. Two gaps:

  1. The pyoptex-gated tests silently skip in CI. pyoptex is not declared anywhere in pyproject.toml, so CI's uv sync --all-extras never installs it. Every @_skip_no_pyoptex test is skipped on every run.
  2. Coverage gaps in the fallback / adapter / dispatch branches and in the pyoptex path (categorical factors, multiple hard-to-change factors, model-type variants).

This PR boosts coverage.

Key finding (shapes the approach)

The trigger for this work, upstream PR mborn1/pyoptex#49 (loosen plotly/pandas/scikit-learn pins), is merged but not released to PyPI. The latest release pyoptex==1.2.1 still pins plotly~=5.24 (<6), which conflicts with this repo's plotly>=6.5.2 (verified: pip resolution fails). So pyoptex cannot be added to the --all-extras resolution from PyPI today without breaking CI.

We therefore keep pyoptex optional (the architecture already degrades cleanly: D-optimal has a point-exchange fallback; I/A-optimal raise a clear ImportError) and get real test signal from an isolated, non-blocking CI job that installs pyoptex from git main.

Changes

  • CI: new non-blocking test-with-pyoptex job that installs pyoptex from git main and runs the optimal-design tests, so the gated paths get exercised without coupling core resolution to an unreleased upstream.
  • Tests (no pyoptex needed): fallback edge cases - SEC-19 candidate-set cap, n_points >= k+1 floor, budget capping, model-type passthrough.
  • Tests (pyoptex path): categorical-factor conversion, multiple hard-to-change factors, model-type variants, a direct unit test of _convert_factors_to_pyoptex, and D/I/A criterion differentiation.
  • Docs: a "reliance on pyoptex" assessment in docs/doe/coverage.md - optional by design, BSD-3 (vendoring possible but a poor trade given the Cython engine), infrequent releases, exit criterion for promoting it to a declared dependency.
  • Version/changelog/citation bump per the repo conventions.

https://claude.ai/code/session_01RmvzhdRZ7K2WDDxtu5ej81


Generated by Claude Code

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants