Opened 2 years ago
Closed 22 months ago
#29964 closed enhancement (fixed)
Make libs doctests ready for random seeds
Reported by:  ghkliem  Owned by:  

Priority:  major  Milestone:  sage9.3 
Component:  doctest framework  Keywords:  
Cc:  Dave Morris  Merged in:  
Authors:  Jonathan Kliem  Reviewers:  Marc Mezzarobba 
Report Upstream:  N/A  Work issues:  
Branch:  2995c47 (Commits, GitHub, GitLab)  Commit:  2995c477d7c9eabc2744636e601427312d321d07 
Dependencies:  Stopgaps: 
Description (last modified by )
This ticket makes
sage t long randomseed=n src/sage/libs/
pass for different values n
than just 0
.
Change History (14)
comment:1 Changed 2 years ago by
Description:  modified (diff) 

comment:2 Changed 2 years ago by
comment:3 Changed 2 years ago by
Dependencies:  → #29962 

comment:4 Changed 2 years ago by
Milestone:  sage9.2 → sage9.3 

comment:5 Changed 23 months ago by
The NTL function randomBits
is documented incorrectly. Of course it returns a random number with n
random bits which corresponds to a random number in [0, 2^n)
and not 2^(n1)
as claimed.
comment:6 Changed 23 months ago by
Authors:  → Jonathan Kliem 

Branch:  → public/29964 
Cc:  Dave Morris added 
Commit:  → 080538b3c6a7d2c2a99d27c41d96ffad59d232fd 
Status:  new → needs_review 
New commits:
080538b  make sage/libs ready for implicit fuzzing of doctests

comment:7 Changed 23 months ago by
Dependencies:  #29962 → #29969 

Status:  needs_review → needs_work 
list(mult for factor, mult in decomp) <= list(range(2, 2 + len(decomp)))
This does not test for a sublist. I will implement such a quick test in #29969.
comment:8 Changed 23 months ago by
Commit:  080538b3c6a7d2c2a99d27c41d96ffad59d232fd → 6e02a466ca9635800b3659ba749ea477d1a18b9f 

Branch pushed to git repo; I updated commit sha1. New commits:
6e02a46  properly check if the list is strictly increasing

comment:9 Changed 23 months ago by
Dependencies:  #29969 

Status:  needs_work → needs_review 
comment:10 Changed 23 months ago by
Reviewers:  → Marc Mezzarobba 

I think I would have kept the examples in gauss()
(and flagged it as random), and maybe removed the test that the matrix is not reduced (no real point IMO). But that's not big deal: please feel free to set the ticket to positive_review on my behalf either after changing that or if you disagree.
comment:11 Changed 23 months ago by
Commit:  6e02a466ca9635800b3659ba749ea477d1a18b9f → 2995c477d7c9eabc2744636e601427312d321d07 

Branch pushed to git repo; I updated commit sha1. New commits:
2995c47  keep a random doctest for illustration

comment:12 Changed 23 months ago by
Ok, I added again one of the examples of gauss
for illustration.
The test that the matrix is not reduced really tests that the remaining rows are all zero, which tests that the functions has worked correctly, I guess.
comment:14 Changed 22 months ago by
Branch:  public/29964 → 2995c477d7c9eabc2744636e601427312d321d07 

Resolution:  → fixed 
Status:  positive_review → closed 
At least the following will need to be fixed: