sagemath/sage

Make matrix doctests ready for random seeds

Closed this issue · 20 comments

kliem commented

This ticket makes

sage -t --long --random-seed=n src/sage/matrix/

pass for n more general than just 0.

Depends on #29962

CC: @slel

Component: doctest framework

Keywords: random_seed, fuzz

Author: Jonathan Kliem

Branch/Commit: 4fceeae

Reviewer: Samuel Lelièvre

Issue created by migration from https://trac.sagemath.org/ticket/29976

kliem commented
comment:1

I have a very partial fix. But even after that the following still need to be taken care of

sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_cyclo_dense.pyx  # 3 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_generic_dense.pyx  # 1 doctest failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_gf2e_dense.pyx  # 67 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_integer_dense_saturation.py  # 2 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_integer_dense.pyx  # 3 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_modn_dense_double.pyx  # 13 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_modn_dense_float.pyx  # 12 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_modn_dense_template.pxi  # 77 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_modn_sparse.pyx  # 3 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_rational_dense.pyx  # 4 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_space.py  # 5 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix_sparse.pyx  # 1 doctest failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/matrix1.pyx  # 1 doctest failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/matrix/special.py  # 37 doctests failed
kliem commented

Branch: public/29976

Branch pushed to git repo; I updated commit sha1. New commits:

da1c6bestart from a "random" random seed for doctesting
b7b836dmake random seed reproducible
eedbe5edocument random_seed
998b1b9default random seed 0 for now
1d7b00edash instead of underscore for command line options
9daa68bpartially make matrix fuzz ready
comment:5

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

kliem commented

Description changed:

--- 
+++ 
@@ -3,5 +3,4 @@
 ```
 sage -t --long --random-seed=n src/sage/matrix/
 ```
-pass for different values `n` than just `0`.
-
+pass for n more general than just 0. 

Changed commit from 9daa68b to bf7fd3b

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

bf7fd3bfix for matrix2 and matrix_mod2_dense
kliem commented

Changed branch from public/29976 to public/29976-reb

kliem commented

Changed commit from bf7fd3b to c1c315c

kliem commented

New commits:

0cc4d56make some parts of matrix ready for random seeds
c1c315cmake other part of matrix ready for random seeds
kliem commented

Author: Jonathan Kliem

slel commented

Changed keywords from none to random_seed, fuzz

slel commented

Reviewer: Samuel Lelièvre

slel commented
comment:10

A typo in src/sage/matrix/matrix_rational_dense.pyx
prevents the HTML documentation from building.

To fix it, change this in the docstring of randomize:

-        The default density is ``6/9`::
+        The default density is `6/9`::

After fixing that, success doctesting src/sage/matrix
be it with the random seed in the ticket description
or with a few extra random ones.

Instead of using l (lowercase L) to name a list,
in many cases a more descriptive name can be used
and is less confusing; for a list of matrix entries,
why not call it entries for example?

Branch pushed to git repo; I updated commit sha1. New commits:

4fceeaefix documentation build

Changed commit from c1c315c to 4fceeae

slel commented
comment:12

Minor improvements such as renaming a list
from l to entries can be done later.

kliem commented
comment:13

Thank you.

Changed branch from public/29976-reb to 4fceeae