Repository navigation
Fix platform-dependent TMD valley test; add opt-in fragile-test probe - #1
Merged
Merged
Conversation
test_tmd_three_band located the K/K' Berry-curvature peaks with argmin/argmax, but the plaquettes on either side of each valley tie to rounding (~1e-15), so the index differed between macOS and Linux CI. Compare the curvature at the expected plaquettes with the extrema instead. tests/fragile_probe.py (enabled with `pytest tests/ --fragile`) flags test-side argmax/argmin/argsort near-ties and exact non-integer float assertEqual calls, to catch this class of failure locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
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
test_tmd_three_band(failing on Linux CI). It located the K/K′ Berry-curvature peaks withargmin/argmax, but the two plaquettes on either side of each valley tie to rounding (~1e-15), so the winning index was (20, 10) on macOS and (19, 9) on Linux. The test now checks that the curvature at the expected plaquettes equals the min/max, plus the sign and the existing ±symmetry check. Library results were correct; no CHANGELOG entry.tests/fragile_probe.py, opt-in viapytest tests/ --fragile. Flagsnp.argmax/argmin/argsortcalled from test code on float data whose deciding values tie within 1e-9 (relative), and exactassertEqualon non-integer floats. Prints a "fragile probe" section at the end of the run; off by default, so normal runs and CI are unchanged.Audit
Ran the full suite with the probe. The 9 remaining candidates were each checked and are benign (ties among degenerate values compared only as values, peaks with ≥2e-5 relative margin, exact comparisons of parsed constants or the same code path). Limits: it only sees ties present on the machine it runs on, and cannot intercept array-method calls like
x.argmin().Test plan
pytest tests/— 891 passed, 9 skippedpytest tests/ --fragile— same, with the probe report🤖 Generated with Claude Code