Skip to content

Enforce nonzero Schur split factors - #484

Open
leninworld wants to merge 1 commit into
py-econometrics:mainfrom
leninworld:fix-nonzero-schur-split-426
Open

leninworld wants to merge 1 commit into
py-econometrics:mainfrom
leninworld:fix-nonzero-schur-split-426

Conversation

@leninworld

Copy link
Copy Markdown
Contributor

This PR fixes issue #426.

Rust’s ApproxSchurConfig::split now uses NonZeroU32, so zero cannot be constructed or deserialized. Python stores the same invariant while keeping its integer API, defaults, read-only getter and existing ValueError message. Positive serialized values retain their encoding; existing binary fixtures are unchanged. The Rust field-type change is documented as breaking under Unreleased.

Validation:

  • Full Docker validation: 573 Rust tests/doctests passed, one existing ignored; rebuilt Python suite passed; 97.28% line coverage. The baseline fails the zero-deserialization regression; the candidate passes, including nine positive-wire cases, both type examples, existing fixtures, pickle and solver reuse.
  • Formatting, warnings-denied Clippy, MSRV 1.85, deny, semver against 0.4, release wheel/sdist, installed-wheel API demo and benchmark smoke passed.
  • Ruff 0.9.10 lint and formatting checks passed on both changed Python files. A single assertion-wrap adjustment after the full run is AST-identical to the tested file; the Ruff run checks those final bytes.

The Docker runs use native Linux ARM64/Python 3.12. They do not claim the upstream x64/free-threaded, macOS, Windows or complete release-wheel matrix. If #482 lands first, its new factor_config conversion site will need .get() too.

Recorded Docker validation summaries, not fresh terminal captures:

Recorded core validation

Recorded API behavior

Prepared with AI assistance.

Closes #426.

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.

One contract for the Schur split factor

1 participant