-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Fix infinite loop bug in doctest from #36581 #38209
Fix infinite loop bug in doctest from #36581 #38209
Conversation
Should "p: CI Fix" be added? |
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.
Please be sure to test this locally:
**********************************************************************
File "src/sage/stats/distributions/discrete_gaussian_lattice.py", line 484, in sage.stats.distributions.discrete_gaussian_lattice.DiscreteGaussianDistributionLatticeSampler.__init__
Failed example:
v = vector(ZZ, n, (0, 0))
Exception raised:
Traceback (most recent call last):
File "/home/travis/sage-build/src/sage/doctest/forker.py", line 715, in _run
self.compile_and_execute(example, compiler, test.globs)
File "/home/travis/sage-build/src/sage/doctest/forker.py", line 1147, in compile_and_execute
exec(compiled, globs)
File "<doctest sage.stats.distributions.discrete_gaussian_lattice.DiscreteGaussianDistributionLatticeSampler.__init__[23]>", line 1, in <module>
v = vector(ZZ, n, (Integer(0), Integer(0)))
File "sage/modules/free_module_element.pyx", line 535, in sage.modules.free_module_element.vector
raise ValueError("incompatible degrees in vector constructor")
ValueError: incompatible degrees in vector constructor
It subsequently hangs on line 486.
See also the linter. |
My bad. I changed my editor config at some time and must have removed the trailing whitespace highlighting.. |
(I'm fixing the hang(?), give me a second) |
|
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.
Some progress, but now line 501 hangs.
It doesn't hang for me..? can you give me a seed |
78175743252608910157834302274104155990 |
For the record, I am also testing with |
I will have a look. I only test with |
This one seed seems particularly bad; when I tried a few more times, everything passes. |
Okay. My |
Okay so as it turns out I can't do math. I accidentally coded the solution to |
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.
Thank you. Then if the bots come back green, then we can set this to a positive review.
Documentation preview for this PR (built with commit 62e8425; changes) is ready! 🎉 |
Discovered by tornaria [here](sagemath#3658 1/files/5c51f54b1a193c3f9964da3e1388efd87623d45c#r1575566025). Sorry for the incorrect implementation! Please merge this quickly, before the next beta (I think). URL: sagemath#38209 Reported by: grhkm21 Reviewer(s): Travis Scrimshaw
Discovered by tornaria [here](sagemath#3658 1/files/5c51f54b1a193c3f9964da3e1388efd87623d45c#r1575566025). Sorry for the incorrect implementation! Please merge this quickly, before the next beta (I think). URL: sagemath#38209 Reported by: grhkm21 Reviewer(s): Travis Scrimshaw
Discovered by tornaria here.
Sorry for the incorrect implementation! Please merge this quickly, before the next beta (I think).