Repository navigation
Test the book's examples against WMA's results - #8
Merged
Merged
Conversation
The examples of Pemmaraju and Skiena's "Computational Discrete Mathematics" (Chapters 3 to 5, "New Features" and the tutorial notebook) become test/test_book_examples.py: each notebook's cells run in order in one session with the package loaded, and the cells whose WMA 15 result is deterministic are checked against it. book/ holds the cells, the WMA and Mathics3 runs they are made from, the harnesses that make those runs, and make_tests.py, which writes test/data/book/. By default the tests take the cells that ran in at most 1 s (COMBINATORICA_BOOK_SECS raises that), and stop any cell after 30 s. book/xfail.json lists the cells that need fixes not yet merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
WOW! One thing I have learned over these many years is that when someone has a vision and is better than you, the best thing you can do is get out of the guy's way. |
Contributor
Author
|
@rocky Glad to hear, thank you! |
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.
The examples of Pemmaraju and Skiena's Computational Discrete Mathematics (Chapters 3 to 5, "New Features" and the tutorial notebook) as tests, checked against what WMA 15 gives.
test/test_book_examples.pyevaluates each notebook's cells in order, in one session with the package loaded. A cell whose WMA result is deterministic (the same under two random seeds, not timing anything) is checked against it; the others are evaluated, since later cells use what they define, but not checked.book/holds the cells, the WMA and Mathics3 runs the test data is made from, the harnesses that make those runs, andmake_tests.py, which writestest/data/book/.book/README.mdsays how to refresh it.COMBINATORICA_BOOK_SECS=5takes more), and any cell is stopped after 30 s. A cell that uses a symbol which a skipped cell assigns is skipped too.Checked cells: 201 (Chapter 3), 96 (Chapter 4), 197 (Chapter 5), 47 (New Features), 50 (tutorial).
With
COMBINATORICA_BOOK_SECS=5: 807 passed on mathics-core with the open fixes and package PR #7; 21 fail on mathics-core master with this package's master. Those 21 are inbook/xfail.jsonwith the fix each one needs (Transpose of deep lists mathics-core#2090, the Compile-style argument patterns #7, the recursion limit mathics-core#2080, and part assignment mathics-core#2083–#2085), as non-strict xfails, so they can be dropped from the list as the fixes are merged.🤖 Generated with Claude Code