Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Rename test class in moodsym
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Mar 25, 2022
1 parent d4481b2 commit 4cbfec1
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions src/sage/modular/modsym/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from sage.misc.misc import cputime


class Test:
class _Test:
"""
Modular symbol testing class.
"""
Expand All @@ -52,13 +52,13 @@ def __init__(self, levels=20, weights=4, onlyg0=False, onlyg1=False,
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test()
sage: from sage.modular.modsym.tests import _Test
sage: _Test()
Modular symbols testing class
sage: T = Test(weights=[3,5,7])
sage: T = _Test(weights=[3,5,7])
sage: T.weights
[3, 5, 7]
sage: T = Test(levels=5) ; T.levels
sage: T = _Test(levels=5) ; T.levels
[1, 2, 3, 4, 5]
"""
if not isinstance(levels, list):
Expand All @@ -82,8 +82,8 @@ def __repr__(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().__repr__()
sage: from sage.modular.modsym.tests import _Test
sage: _Test().__repr__()
'Modular symbols testing class'
"""
return "Modular symbols testing class"
Expand All @@ -95,8 +95,8 @@ def _modular_symbols_space(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: T = Test(levels=[5],weights=[2], onlychar=True)
sage: from sage.modular.modsym.tests import _Test
sage: T = _Test(levels=[5],weights=[2], onlychar=True)
Note that the sign of the generated space is always arbitrary.
sage: T._modular_symbols_space()
Expand Down Expand Up @@ -132,8 +132,8 @@ def _level_weight_sign(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test()._level_weight_sign() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test()._level_weight_sign() # random
level = 4, weight = 3, sign = 1
(4, 3, 1)
"""
Expand All @@ -151,8 +151,8 @@ def _modular_symbols_space_gamma0(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test()._modular_symbols_space_gamma0() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test()._modular_symbols_space_gamma0() # random
level = 1, weight = 3, sign = 0
Modular Symbols space of dimension 0 for Gamma_0(1) of weight 3 with sign 0 over Rational Field
"""
Expand All @@ -169,8 +169,8 @@ def _modular_symbols_space_gamma1(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test()._modular_symbols_space_gamma1() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test()._modular_symbols_space_gamma1() # random
level = 3, weight = 4, sign = 0
Modular Symbols space of dimension 2 for Gamma_1(3) of weight 4 with sign 0 over Rational Field
"""
Expand All @@ -187,8 +187,8 @@ def _modular_symbols_space_character(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test()._modular_symbols_space_character() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test()._modular_symbols_space_character() # random
level = 18, weight = 3, sign = 0
Modular Symbols space of dimension 0 and level 18, weight 3, character [1, zeta6 - 1], sign 0, over Cyclotomic Field of order 6 and degree 2
"""
Expand All @@ -206,13 +206,13 @@ def _do(self, name):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test()._do("random")
sage: from sage.modular.modsym.tests import _Test
sage: _Test()._do("random")
test_random
...
"""
print("test_%s" % name)
Test.__dict__["test_%s" % name](self)
_Test.__dict__["test_%s" % name](self)

#################################################################
# The tests
Expand All @@ -224,8 +224,8 @@ def random(self, seconds=0):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().random(1)
sage: from sage.modular.modsym.tests import _Test
sage: _Test().random(1)
test_random
...
"""
Expand All @@ -239,11 +239,11 @@ def test(self, name, seconds=0):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().test('cs_dimension',seconds=1)
sage: from sage.modular.modsym.tests import _Test
sage: _Test().test('cs_dimension',seconds=1)
test_cs_dimension
...
sage: Test().test('csnew_dimension',seconds=1)
sage: _Test().test('csnew_dimension',seconds=1)
test_csnew_dimension
...
"""
Expand All @@ -266,8 +266,8 @@ def test_cs_dimension(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().test_cs_dimension() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test().test_cs_dimension() # random
gamma0
level = 16, weight = 3, sign = -1
Modular Symbols space of dimension 0 for Gamma_0(16) of weight 3 with sign -1 over Rational Field
Expand All @@ -281,8 +281,8 @@ def test_csnew_dimension(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().test_csnew_dimension() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test().test_csnew_dimension() # random
gamma0
level = 3, weight = 3, sign = 1
Modular Symbols space of dimension 0 for Gamma_0(3) of weight 3 with sign 1 over Rational Field
Expand All @@ -301,8 +301,8 @@ def test_csns_nscs(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().test_csns_nscs() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test().test_csns_nscs() # random
gamma0
level = 5, weight = 4, sign = 1
Modular Symbols space of dimension 3 for Gamma_0(5) of weight 4 with sign 1 over Rational Field
Expand All @@ -325,8 +325,8 @@ def test_decomposition(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().test_decomposition() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test().test_decomposition() # random
gamma1
level = 10, weight = 4, sign = 0
Modular Symbols space of dimension 18 for Gamma_1(10) of weight 4 with sign 0 over Rational Field
Expand All @@ -341,8 +341,8 @@ def test_dimension(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().test_dimension() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test().test_dimension() # random
gamma1
level = 14, weight = 2, sign = -1
Modular Symbols space of dimension 1 for Gamma_1(14) of weight 2 with sign -1 over Rational Field
Expand All @@ -355,15 +355,15 @@ def test_random(self):
EXAMPLES::
sage: from sage.modular.modsym.tests import Test
sage: Test().test_random() # random
sage: from sage.modular.modsym.tests import _Test
sage: _Test().test_random() # random
Doing random test test_csnew_dimension
character
level = 18, weight = 4, sign = -1
Modular Symbols space of dimension 0 and level 18, weight 4, character [1, -1], sign -1, over Rational Field
"""
tests = [a for a in Test.__dict__
tests = [a for a in _Test.__dict__
if a[:5] == "test_" and a != "test_random"]
name = random.choice(tests)
print("Doing random test %s" % name)
Test.__dict__[name](self)
_Test.__dict__[name](self)

0 comments on commit 4cbfec1

Please sign in to comment.