Skip to content

Commit ddb0ff9

Browse files
committed
make "num_cusps_of_width" an alias
1 parent f4adc25 commit ddb0ff9

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

src/sage/modular/etaproducts.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ def EtaProduct(level, dic) -> EtaGroupElement:
662662
return EtaGroup(level)(dic)
663663

664664

665-
def num_cusps_of_width(N, d) -> Integer:
665+
def ncusps_of_width(N, d) -> Integer:
666666
r"""
667667
Return the number of cusps on `X_0(N)` of width ``d``.
668668
@@ -674,13 +674,21 @@ def num_cusps_of_width(N, d) -> Integer:
674674
675675
EXAMPLES::
676676
677-
sage: from sage.modular.etaproducts import num_cusps_of_width
678-
sage: [num_cusps_of_width(18,d) for d in divisors(18)]
677+
sage: from sage.modular.etaproducts import ncusps_of_width
678+
sage: [ncusps_of_width(18,d) for d in divisors(18)]
679679
[1, 1, 2, 2, 1, 1]
680-
sage: num_cusps_of_width(4,8)
680+
sage: ncusps_of_width(4,8)
681681
Traceback (most recent call last):
682682
...
683683
ValueError: N and d must be positive integers with d|N
684+
685+
TESTS:
686+
687+
The old method name is kept as an alias::
688+
689+
sage: from sage.modular.etaproducts import num_cusps_of_width
690+
sage: [num_cusps_of_width(6,d) for d in divisors(6)]
691+
[1, 1, 1, 1]
684692
"""
685693
N = ZZ(N)
686694
d = ZZ(d)
@@ -690,6 +698,9 @@ def num_cusps_of_width(N, d) -> Integer:
690698
return euler_phi(d.gcd(N // d))
691699

692700

701+
num_cusps_of_width = ncusps_of_width
702+
703+
693704
def AllCusps(N) -> list:
694705
r"""
695706
Return a list of CuspFamily objects corresponding to the cusps of
@@ -714,7 +725,7 @@ def AllCusps(N) -> list:
714725

715726
c = []
716727
for d in divisors(N):
717-
n = num_cusps_of_width(N, d)
728+
n = ncusps_of_width(N, d)
718729
if n == 1:
719730
c.append(CuspFamily(N, d))
720731
elif n > 1:
@@ -751,9 +762,9 @@ def __init__(self, N, width, label=None):
751762
self._width = width
752763
if N % width:
753764
raise ValueError("bad width")
754-
if num_cusps_of_width(N, width) > 1 and label is None:
755-
raise ValueError("there are %s > 1 cusps of width %s on X_0(%s): specify a label" % (num_cusps_of_width(N, width), width, N))
756-
if num_cusps_of_width(N, width) == 1 and label is not None:
765+
if ncusps_of_width(N, width) > 1 and label is None:
766+
raise ValueError("there are %s > 1 cusps of width %s on X_0(%s): specify a label" % (ncusps_of_width(N, width), width, N))
767+
if ncusps_of_width(N, width) == 1 and label is not None:
757768
raise ValueError("there is only one cusp of width %s on X_0(%s): no need to specify a label" % (width, N))
758769
self.label = label
759770

0 commit comments

Comments
 (0)