CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix combinatorics failures from repeated test runs #15167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Before introduction of the keyword `max_cosets`, the only way to control the maximum number of cosets in a coset enumeration was by changing the class attribute `coset_table_max_limit`. If not restored to the original value, the change in attribute affects all subsequent coset enumerations causing doctests to fail if run twice in the same process. This commit changes the tests to use `max_cosets` instead but also modifies the code of CosetTable to allow the attribute change to be preserved even if `max_cosets` is used after the change
âś… Hi, I am the SymPy bot (v129). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.2.1. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
This seems to fix the recursion errors, but I still get doctest failures in combinatorics from doctest('comb', subprocess=False)
doctest('comb', subprocess=False) |
Oh scratch that I didn't see the latest commit. |
@@ -533,6 +534,7 @@ def rotate(self, perm): | |||
|
|||
>>> from sympy.combinatorics import Polyhedron, Permutation | |||
>>> from sympy.combinatorics.polyhedron import cube | |||
>>> cube = cube.copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these objects are supposed to be imported and used like this it seems they shouldn't be mutable. Actually it looks like they are Basic instances, which shouldn't ever be mutable. I think either it should not be Basic, or the methods like rotate
should return new instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of making them immutable but that would be a backward compatibility break, and I wasn't sure if it was worth it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can open a new issue about it. For now, this PR seems to fix the failures from the combinatorics and group modules, so I'm +1 to merge it.
Part of what's being done in #15163
See #15149 for other failures
Before the introduction of keyword
max_cosets
, the only way tocontrol the maximum number of cosets in a coset enumeration was
by changing the class attribute
CosetTable.coset_table_max_limit
. If notrestored to the original value, the change in attribute affects
all subsequent coset enumerations. This caused doctests to fail if run
twice in the same process. This PR changes the tests to use
max_cosets
instead and modifies the code ofCosetTable
toallow the attribute change to be preserved even if
max_cosets
is used after the change.
The failures in
polyhedron
were due to the fact thatPolyhedron
is a mutable object and the doctests imported pre-computed standard polyhedra (liketetrahedron
andcube
) and performed operations so that when they were imported next time, they were no longer in their standard state. I've changed doctests to create a copy firstRelease Notes
CosetTable.coset_table_max_limit
is no longer overwritten whenmax_cosets
keyword is used