Repository navigation
Conversation
test_depth computed each of its 153 comparisons and dropped it, and so did the last two lines of test_sub_mesh_pattern, so none of them could fail. Each is now asserted. All of them hold, so no result changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Two tests computed comparisons and dropped them, so those lines could never fail. All 153 lines of
test_depth, intests/patterns/test_perm.py, read likePerm((1, 0)).depth() == 1, with noassert. So did the last two lines oftest_sub_mesh_pattern, intests/patterns/test_meshpatt.py. Each of these 155 comparisons is now asserted, and no code changes:test_depthheld the linePerm((1, 0)).depth() == 1, which computedTrueand dropped it. It now readsassert Perm((1, 0)).depth() == 1.Details
Why
A comparison that is not asserted cannot fail.
test_depthpassed whateverPerm.depthreturned, and the two lines oftest_sub_mesh_patternpassed whateverMeshPatt.sub_mesh_patterngave for their cases. All 155 comparisons hold ondevelop, so asserting them changes no result today. It makes the tests check what they compute, for anyone who changes these methods later.A scan of every test file with Python's
astmodule finds no other comparison computed and dropped. The only others are the three intest_last_skew_component, which #217 asserts.What changes
tests/patterns/test_perm.py:assertin front of each oftest_depth's 153 comparisons. Their values are FindStat's St000029, as the test's comment says.tests/patterns/test_meshpatt.py:assertin front of the last two comparisons oftest_sub_mesh_pattern.assertat its start and nothing else. black leaves both files as they are.CHANGELOG.md, as nothing outside the tests changes.Checks
develop's counts, as the change adds no test.develop's with exactly those comparisons asserted.develop's code. The 153 depths, one for every permutation of length 1 to 5, agree with depth as Petersen and Tenner define it, the sum of π(i) − i over the excedances, computed apart from Permuta. The two sub-mesh patterns agree with the shading worked out by hand.Perm.depthadds the index where it should subtract it,test_depthnow fails, where it passed before; so does it whenPerm.depthcounts the excedances instead of summing them, which the doctest ofdepthcatches too. Every fault tried inMeshPatt.sub_mesh_patternalready failedtest_sub_mesh_patternat an earlier line; the two new asserts check two more cases, the second the point-free condition.developwith this Permuta, on both Pythons.developinCHANGELOG.mdas it stands, and this change leaves that file alone.AI assistance: written with Claude Code (Opus 5.5) as the Permuta developer, and reviewed before submission by Claude Code (Opus 5.5) as an automated reviewer; Henning Ulfarsson checked and opened it.