sagemath/sage

sage.tensor.modules: make doctests involving SR optional

Closed this issue · 18 comments

After #32415 and #32708, the code in the module sage.tensor.modules does no longer contain any dependency on symbolic parts of Sage. There remains however some doctests that invokes SR. They have been introduced to check a bug fix performed in #22520. In view of Sage modularization, they are marked # optional - sage.symbolic in this ticket.

Depends on #32708
Depends on #32614

CC: @mkoeppe @tscrim

Component: refactoring

Author: Eric Gourgoulhon

Branch/Commit: c3ff514

Reviewer: Matthias Koeppe

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

Author: Eric Gourgoulhon

New commits:

1635bd3Remove import of Chart in sage.tensor.modules (#32708)
f46cce7Remove SR doctests in sage.tensor.modules (#32712)
comment:2

Instead of removing them, they could be marked as optional using #32614: See #32652 for an example

comment:3

Replying to @mkoeppe:

Instead of removing them, they could be marked as optional using #32614: See #32652 for an example

Very good. Should the tag be # optional - sage.symbolic.ring ?

comment:4

see src/sage/features/sagemath.py (after merging #32614): just sage.symbolic

Changed dependencies from #32708 to #32708, #32614

comment:5

Replying to @mkoeppe:

see src/sage/features/sagemath.py (after merging #32614): just sage.symbolic

OK, perfect.

Changed commit from f46cce7 to c3ff514

Description changed:

--- 
+++ 
@@ -1 +1 @@
-After #32415 and #32708, the code in the module `sage.tensor.modules` does no longer contain any dependency on symbolic parts of Sage. There remains however some doctests that invokes `SR`. They have been introduced to check a bug fix performed in #22520. Since this was 5 years ago, it seems pretty safe to remove them for the benefit of Sage modularization. This is performed in this ticket. 
+After #32415 and #32708, the code in the module `sage.tensor.modules` does no longer contain any dependency on symbolic parts of Sage. There remains however some doctests that invokes `SR`. They have been introduced to check a bug fix performed in #22520. In view of Sage modularization, they are marked `# optional - sage.symbolic` in this ticket.

New commits:

c3ff514Make SR doctests optional in sage.tensor.modules (#32712)
comment:7

Here we go...

Reviewer: Matthias Koeppe

comment:8

Tested with #32601:

$ ./bootstrap && make sagelib-build-deps && ./sage -sh -c '(cd pkgs/sagemath-standard-no-symbolics && SAGE_NUM_THREADS=16 tox  -v -v -v -e py39-sagewheels-nopypi)'
[...........]
$ pkgs/sagemath-standard-no-symbolics/.tox/py39-sagewheels-nopypi/bin/sage -tp src/sage/tensor
too many failed tests, not using stored timings
Running doctests with ID 2021-10-18-23-57-24-ccafbd20.
Using --optional=argcomplete,build,ccache,dochtml,e_antic,homebrew,normaliz,pip,pynormaliz,sage,sage.rings.real_double,sage_spkg
Sorting sources by runtime so that slower doctests are run first....
Doctesting 19 files using 8 threads.
sage -t --random-seed=0 src/sage/tensor/modules/free_module_morphism.py
    [251 tests, 0.21 s]
sage -t --random-seed=0 src/sage/tensor/modules/free_module_automorphism.py
    [243 tests, 0.20 s]
sage -t --random-seed=0 src/sage/tensor/modules/free_module_alt_form.py
    [170 tests, 0.28 s]
sage -t --random-seed=0 src/sage/tensor/modules/alternating_contr_tensor.py
    [150 tests, 0.32 s]
sage -t --random-seed=0 src/sage/tensor/modules/free_module_linear_group.py
    [112 tests, 0.16 s]
sage -t --random-seed=0 src/sage/tensor/modules/finite_rank_free_module.py
    [523 tests, 0.42 s]
sage -t --random-seed=0 src/sage/tensor/modules/ext_pow_free_module.py
    [187 tests, 0.15 s]
sage -t --random-seed=0 src/sage/tensor/modules/free_module_basis.py
    [166 tests, 0.14 s]
sage -t --random-seed=0 src/sage/tensor/modules/free_module_homset.py
    [97 tests, 0.14 s]
sage -t --random-seed=0 src/sage/tensor/__init__.py
    [0 tests, 0.00 s]
sage -t --random-seed=0 src/sage/tensor/all.py
    [0 tests, 0.00 s]
sage -t --random-seed=0 src/sage/tensor/modules/__init__.py
    [0 tests, 0.00 s]
sage -t --random-seed=0 src/sage/tensor/modules/all.py
    [0 tests, 0.00 s]
sage -t --random-seed=0 src/sage/tensor/modules/format_utilities.py
    [64 tests, 0.04 s]
sage -t --random-seed=0 src/sage/tensor/modules/free_module_element.py
    [62 tests, 0.08 s]
sage -t --random-seed=0 src/sage/tensor/modules/tensor_free_module.py
    [129 tests, 0.14 s]
sage -t --random-seed=0 src/sage/tensor/modules/free_module_tensor.py
    [638 tests, 2.23 s]
sage -t --random-seed=0 src/sage/tensor/modules/comp.py
    [980 tests, 3.14 s]
sage -t --random-seed=0 src/sage/tensor/modules/tensor_with_indices.py
    [233 tests, 4.01 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 4.1 seconds
    cpu time: 11.0 seconds
    cumulative wall time: 11.6 seconds
comment:9

Thank you for the review and the test!