-
-
Notifications
You must be signed in to change notification settings - Fork 649
simplify some nested for loops #40439
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
@@ -955,7 +955,9 @@ def maximal_order(self, take_shortcuts=True, order_basis=None): | |||
Order of Quaternion Algebra (-22, 210) with base ring Rational Field | |||
with basis (1, i, 1/2*i + 1/2*j, 1/2 + 17/22*i + 1/44*k) | |||
|
|||
sage: for d in ( m for m in range(1, 750) if is_squarefree(m) ): # long time (3s) | |||
sage: for d in range(1, 700): # long time (3s) |
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.
To make the test timing comparable with past versions I would keep the 750, but that's really only a personal opinion, feel free to ignore!
sage: for d in range(1, 700): # long time (3s) | |
sage: for d in range(1, 750): # long time (3s) |
nice! |
I would myself use rather 600 than 750. So I put 700 as a middle step. In principle, tests are not supposed to be long and complicated. |
So, then use a number such that it is no longer a long test. In a fresh session,
seems to be on the very safe side. Besides, I think that would also be the better form of the example, more precisely sage: Q = QuaternionAlgebra
sage: all(Q(d).maximal_order(take_shortcuts=False).is_maximal()
....: for d in range(1, 350) if is_squarefree(d)) |
d'accord ! Voilà |
either using walrus or simpler syntax
📝 Checklist