Skip to content

Commit 5c59f33

Browse files
mantepsetscrim
authored andcommitted
unify docstrings and uncontroversial doctests from #35480 and #35485
1 parent 8edf018 commit 5c59f33

File tree

3 files changed

+101
-43
lines changed

3 files changed

+101
-43
lines changed

src/sage/data_structures/stream.py

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def __ne__(self, other):
185185
def is_nonzero(self):
186186
r"""
187187
Return ``True`` if and only if this stream is known
188-
to be nonzero.
188+
to be non-zero.
189189
190190
The default implementation is ``False``.
191191
@@ -242,7 +242,7 @@ def __init__(self, is_sparse, true_order):
242242

243243
def is_nonzero(self):
244244
r"""
245-
Return ``True`` if and only if the cache contains a nonzero element.
245+
Return ``True`` if and only if the cache contains a non-zero element.
246246
247247
EXAMPLES::
248248
@@ -331,7 +331,7 @@ def __setstate__(self, d):
331331

332332
def __getitem__(self, n):
333333
"""
334-
Return the `n`-th coefficient of ``self``.
334+
Return the ``n``-th coefficient of ``self``.
335335
336336
INPUT:
337337
@@ -432,7 +432,7 @@ def iterate_coefficients(self):
432432
def order(self):
433433
r"""
434434
Return the order of ``self``, which is the minimum index ``n`` such
435-
that ``self[n]`` is nonzero.
435+
that ``self[n]`` is non-zero.
436436
437437
EXAMPLES::
438438
@@ -658,7 +658,7 @@ def __init__(self, initial_coefficients, constant=None, degree=None, order=None)
658658
# complicated otherwise
659659
for i, v in enumerate(initial_coefficients):
660660
if v:
661-
# We have found the first nonzero coefficient
661+
# We have found the first non-zero coefficient
662662
order += i
663663
initial_coefficients = initial_coefficients[i:]
664664
if order + len(initial_coefficients) == self._degree:
@@ -737,7 +737,7 @@ def __getitem__(self, n):
737737
def order(self):
738738
r"""
739739
Return the order of ``self``, which is the minimum index
740-
``n`` such that ``self[n]`` is nonzero.
740+
``n`` such that ``self[n]`` is non-zero.
741741
742742
EXAMPLES::
743743
@@ -868,9 +868,9 @@ def __ne__(self, other):
868868
def is_nonzero(self):
869869
r"""
870870
Return ``True`` if and only if this stream is known
871-
to be nonzero.
871+
to be non-zero.
872872
873-
An assumption of this class is that it is nonzero.
873+
An assumption of this class is that it is non-zero.
874874
875875
EXAMPLES::
876876
@@ -1580,7 +1580,7 @@ def get_coefficient(self, n):
15801580
def is_nonzero(self):
15811581
r"""
15821582
Return ``True`` if and only if this stream is known
1583-
to be nonzero.
1583+
to be non-zero.
15841584
15851585
EXAMPLES::
15861586
@@ -1598,6 +1598,14 @@ def is_nonzero(self):
15981598
return self._left.is_nonzero() and self._right.is_nonzero()
15991599

16001600

1601+
class Stream_cauchy_mul_commutative(Stream_cauchy_mul, Stream_binaryCommutative):
1602+
"""
1603+
Operator for multiplication of two coefficient streams using the
1604+
Cauchy product for commutative multiplication of coefficients.
1605+
"""
1606+
pass
1607+
1608+
16011609
class Stream_dirichlet_convolve(Stream_binary):
16021610
r"""
16031611
Operator for the Dirichlet convolution of two streams.
@@ -1646,7 +1654,7 @@ def _approximate_order(self):
16461654
or self._right._approximate_order <= 0):
16471655
raise ValueError("Dirichlet convolution is only defined for "
16481656
"coefficient streams with minimal index of "
1649-
"nonzero coefficient at least 1")
1657+
"non-zero coefficient at least 1")
16501658
return self._left._approximate_order * self._right._approximate_order
16511659

16521660
def get_coefficient(self, n):
@@ -2224,6 +2232,11 @@ class Stream_scalar(Stream_inexact):
22242232
Base class for operators multiplying a coefficient stream by a
22252233
scalar.
22262234
2235+
INPUT:
2236+
2237+
- ``series`` -- a :class:`Stream`
2238+
- ``scalar`` -- a non-zero, non-one scalar
2239+
22272240
.. TODO::
22282241
22292242
This does not inherit from :class:`Stream_unary`, because of
@@ -2310,7 +2323,7 @@ def __eq__(self, other):
23102323
def is_nonzero(self):
23112324
r"""
23122325
Return ``True`` if and only if this stream is known
2313-
to be nonzero.
2326+
to be non-zero.
23142327
23152328
EXAMPLES::
23162329
@@ -2343,7 +2356,7 @@ class Stream_rmul(Stream_scalar):
23432356
INPUT:
23442357
23452358
- ``series`` -- a :class:`Stream`
2346-
- ``scalar`` -- a scalar
2359+
- ``scalar`` -- a non-zero, non-one scalar
23472360
23482361
EXAMPLES::
23492362
@@ -2385,7 +2398,7 @@ class Stream_lmul(Stream_scalar):
23852398
INPUT:
23862399
23872400
- ``series`` -- a :class:`Stream`
2388-
- ``scalar`` -- a scalar
2401+
- ``scalar`` -- a non-zero, non-one scalar
23892402
23902403
EXAMPLES::
23912404
@@ -2492,7 +2505,7 @@ def get_coefficient(self, n):
24922505
def is_nonzero(self):
24932506
r"""
24942507
Return ``True`` if and only if this stream is known
2495-
to be nonzero.
2508+
to be non-zero.
24962509
24972510
EXAMPLES::
24982511
@@ -2630,9 +2643,9 @@ def iterate_coefficients(self):
26302643
def is_nonzero(self):
26312644
r"""
26322645
Return ``True`` if and only if this stream is known
2633-
to be nonzero.
2646+
to be non-zero.
26342647
2635-
An assumption of this class is that it is nonzero.
2648+
An assumption of this class is that it is non-zero.
26362649
26372650
EXAMPLES::
26382651
@@ -2647,7 +2660,7 @@ def is_nonzero(self):
26472660

26482661
class Stream_map_coefficients(Stream_inexact):
26492662
r"""
2650-
The stream with ``function`` applied to each nonzero coefficient
2663+
The stream with ``function`` applied to each non-zero coefficient
26512664
of ``series``.
26522665
26532666
INPUT:
@@ -2774,7 +2787,7 @@ def is_undefined(self):
27742787

27752788
class Stream_shift(Stream):
27762789
"""
2777-
Operator for shifting a nonzero, nonexact stream.
2790+
Operator for shifting a non-zero, non-exact stream.
27782791
27792792
Instances of this class share the cache with its input stream.
27802793
@@ -2820,7 +2833,7 @@ def _approximate_order(self):
28202833
def order(self):
28212834
r"""
28222835
Return the order of ``self``, which is the minimum index
2823-
``n`` such that ``self[n]`` is nonzero.
2836+
``n`` such that ``self[n]`` is non-zero.
28242837
28252838
EXAMPLES::
28262839
@@ -2889,9 +2902,9 @@ def __eq__(self, other):
28892902
def is_nonzero(self):
28902903
r"""
28912904
Return ``True`` if and only if this stream is known
2892-
to be nonzero.
2905+
to be non-zero.
28932906
2894-
An assumption of this class is that it is nonzero.
2907+
An assumption of this class is that it is non-zero.
28952908
28962909
EXAMPLES::
28972910
@@ -2911,7 +2924,7 @@ def is_undefined(self):
29112924

29122925
class Stream_truncated(Stream_inexact):
29132926
"""
2914-
Operator for shifting a nonzero, nonexact stream that has
2927+
Operator for shifting a non-zero, non-exact stream that has
29152928
been shifted below its minimal valuation.
29162929
29172930
Instances of this class share the cache with its input stream.
@@ -3072,7 +3085,7 @@ def __eq__(self, other):
30723085
def order(self):
30733086
"""
30743087
Return the order of ``self``, which is the minimum index ``n`` such
3075-
that ``self[n]`` is nonzero.
3088+
that ``self[n]`` is non-zero.
30763089
30773090
EXAMPLES::
30783091
@@ -3118,7 +3131,7 @@ def order(self):
31183131
def is_nonzero(self):
31193132
r"""
31203133
Return ``True`` if and only if this stream is known
3121-
to be nonzero.
3134+
to be non-zero.
31223135
31233136
EXAMPLES::
31243137
@@ -3166,7 +3179,7 @@ def is_undefined(self):
31663179

31673180
class Stream_derivative(Stream_inexact):
31683181
"""
3169-
Operator for taking derivatives of a stream.
3182+
Operator for taking derivatives of a non-exact stream.
31703183
31713184
INPUT:
31723185
@@ -3278,7 +3291,7 @@ def __eq__(self, other):
32783291
def is_nonzero(self):
32793292
r"""
32803293
Return ``True`` if and only if this stream is known
3281-
to be nonzero.
3294+
to be non-zero.
32823295
32833296
EXAMPLES::
32843297

0 commit comments

Comments
 (0)