Skip to content

Commit 372ed15

Browse files
committed
add and fix doctests
1 parent d47aebf commit 372ed15

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

src/sage/schemes/elliptic_curves/mod_poly.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ def classical_modular_polynomial(l, j=None):
6666
6767
Increasing the cache size can be useful for repeated invocations::
6868
69-
sage: %timeit classical_modular_polynomial(101) # random
69+
sage: %timeit classical_modular_polynomial(101) # not tested
7070
6.11 s ± 1.21 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
71-
sage: %timeit classical_modular_polynomial(101, GF(65537).random_element()) # random
71+
sage: %timeit classical_modular_polynomial(101, GF(65537).random_element()) # not tested
7272
5.43 s ± 2.71 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
7373
74-
sage: classical_modular_polynomial.set_cache_bound(150)
75-
sage: %timeit classical_modular_polynomial(101) # random
74+
sage: classical_modular_polynomial.set_cache_bound(150) # not tested
75+
sage: %timeit classical_modular_polynomial(101) # not tested
7676
The slowest run took 10.35 times longer than the fastest. This could mean that an intermediate result is being cached.
7777
1.84 µs ± 1.84 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)
78-
sage: %timeit classical_modular_polynomial(101, GF(65537).random_element()) # random
78+
sage: %timeit classical_modular_polynomial(101, GF(65537).random_element()) # not tested
7979
59.8 ms ± 29.4 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
8080
8181
TESTS::
@@ -144,6 +144,23 @@ def classical_modular_polynomial(l, j=None):
144144
return classical_modular_polynomial(l)(j, Y)
145145

146146
def _set_cache_bound(bnd):
147+
r"""
148+
Internal helper function to allow setting the caching cutoff for
149+
:func:`classical_modular_polynomial`.
150+
151+
Exposed as ``classical_modular_polynomial.set_cache_bound()``.
152+
153+
EXAMPLES::
154+
155+
sage: import sage.schemes.elliptic_curves.mod_poly as m
156+
sage: m._cache_bound
157+
100
158+
sage: m._set_cache_bound(123)
159+
sage: m._cache_bound
160+
123
161+
sage: classical_modular_polynomial.set_cache_bound is m._set_cache_bound
162+
True
163+
"""
147164
global _cache_bound
148165
_cache_bound = bnd
149166
classical_modular_polynomial.set_cache_bound = _set_cache_bound

0 commit comments

Comments
 (0)