Skip to content

Commit

Permalink
Docstring edits
Browse files Browse the repository at this point in the history
Remove indefinite articles, change initial docstring verb to prescriptive form, etc.
  • Loading branch information
gmou3 committed Jun 11, 2024
1 parent 0716b41 commit 5f652ff
Show file tree
Hide file tree
Showing 100 changed files with 749 additions and 770 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/affine_nil_temperley_lieb.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, n, R=ZZ, prefix='a'):

def _element_constructor_(self, w):
"""
Constructs a basis element from an element of the Weyl group.
Construct a basis element from an element of the Weyl group.
If `w = w_1 ... w_k` is a reduced word for `w`, then `A(w)` returns
zero if `w` contains braid relations.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/askey_wilson.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ def __eq__(self, other):

def _on_basis(self, c):
r"""
Computes the image of this morphism on the basis element
Compute the image of this morphism on the basis element
indexed by ``c``.
INPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/commutative_dga.py
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ def basis_coefficients(self, total=False):
``True``, it returns the coefficients with respect to
the basis for the total degree of this element
OUTPUT: a list of elements of the base field
OUTPUT: list of elements of the base field
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/lie_algebras/nilpotent_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class NilpotentLieAlgebra_dense(LieAlgebraWithStructureCoefficients):
- ``R`` -- the base ring
- ``s_coeff`` -- a dictionary of structural coefficients
- ``names`` -- (default:``None``) list of strings to use as names of basis
- ``names`` -- (default: ``None``) list of strings to use as names of basis
elements; if ``None``, the names will be inferred from the structural
coefficients
- ``index_set`` -- (default:``None``) list of hashable and comparable
- ``index_set`` -- (default: ``None``) list of hashable and comparable
elements to use for indexing
- ``step`` -- integer (optional); the nilpotency step of the
Lie algebra if known; otherwise it will be computed when needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class GradedLieConformalAlgebra(LieConformalAlgebraWithStructureCoefficients):
- ``category`` The category that this Lie conformal algebra
belongs to.
- ``parity`` -- tuple of ``0`` or ``1`` (Default: tuple of
- ``parity`` -- tuple of ``0`` or ``1`` (default: tuple of
``0``); a tuple specifying the parity of each non-central
generator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def T(self, n=1):
INPUT:
- ``n`` -- nonnegative integer (default:``1``); how many
times to apply `T` to this element.
- ``n`` -- nonnegative integer (default: `1`); how many
times to apply `T` to this element
We use the *divided powers* notation
`T^{(j)} = \frac{T^j}{j!}`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class LieConformalAlgebraWithStructureCoefficients(
INPUT:
- ``R`` -- a ring (Default: ``None``); The base ring of this Lie
- ``R`` -- a ring (default: ``None``); The base ring of this Lie
conformal algebra. Behaviour is undefined if it is not a field
of characteristic zero.
- ``s_coeff`` -- dictionary (Default: ``None``);
- ``s_coeff`` -- dictionary (default: ``None``);
a dictionary containing the `\lambda` brackets of the
generators of this Lie conformal algebra. The family encodes a
dictionary whose keys
Expand All @@ -66,20 +66,20 @@ class LieConformalAlgebraWithStructureCoefficients(
defined by skew-symmetry) is assumed to have vanishing
`\lambda`-bracket.
- ``names`` -- tuple of ``str`` (Default: ``None``); The list of
- ``names`` -- tuple of ``str`` (default: ``None``); The list of
names for generators of this Lie conformal algebra. Do not
include central elements in this list.
- ``central_elements`` -- tuple of ``str`` (Default: ``None``);
- ``central_elements`` -- tuple of ``str`` (default: ``None``);
A list of names for central
elements of this Lie conformal algebra.
- ``index_set`` -- enumerated set (Default: ``None``);
- ``index_set`` -- enumerated set (default: ``None``);
an indexing set for the generators of this Lie
conformal algebra. Do not include central elements in this
list.
- ``parity`` -- tuple of `0` or `1` (Default: tuple of `0`);
- ``parity`` -- tuple of `0` or `1` (default: tuple of `0`);
a tuple specifying the parity of each non-central generator.
EXAMPLES:
Expand Down Expand Up @@ -127,7 +127,7 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None):
generators (not counting the central elements).
- ``ce`` -- a tuple of ``str``; a list of names for the central
generators of this Lie conformal algebra
- ``parity`` -- a tuple of `0` or `1` (Default: tuple of `0`);
- ``parity`` -- a tuple of `0` or `1` (default: tuple of `0`);
this tuple specifies the parity of each non-central generator.
OUTPUT:
Expand Down
12 changes: 6 additions & 6 deletions src/sage/algebras/quatalg/quaternion_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ def invariants(self):

def is_definite(self):
"""
Checks whether the quaternion algebra ``self`` is definite, i.e. whether it ramifies at the
Check whether the quaternion algebra ``self`` is definite, i.e. whether it ramifies at the
unique Archimedean place of its base field QQ. This is the case if and only if both
invariants of ``self`` are negative.
Expand Down Expand Up @@ -2007,7 +2007,7 @@ def _left_ideal_basis(self, gens):
- ``gens`` -- list of elements of ``self``
OUTPUT: a list of four elements of ``self``
OUTPUT: list of four elements of ``self``
EXAMPLES::
Expand Down Expand Up @@ -3561,7 +3561,7 @@ def pullback(self, J, side=None):

def is_equivalent(self, J, B=10, certificate=False, side=None):
r"""
Checks whether ``self`` and ``J`` are equivalent as ideals.
Check whether ``self`` and ``J`` are equivalent as ideals.
Tests equivalence as right ideals by default. Requires the underlying
rational quaternion algebra to be definite.
Expand Down Expand Up @@ -3603,7 +3603,7 @@ def is_equivalent(self, J, B=10, certificate=False, side=None):

def is_left_equivalent(self, J, B=10, certificate=False):
r"""
Checks whether ``self`` and ``J`` are equivalent as left ideals.
Check whether ``self`` and ``J`` are equivalent as left ideals.
Requires the underlying rational quaternion algebra to be definite.
INPUT:
Expand All @@ -3626,7 +3626,7 @@ def is_left_equivalent(self, J, B=10, certificate=False):

def is_right_equivalent(self, J, B=10, certificate=False):
r"""
Checks whether ``self`` and ``J`` are equivalent as right ideals.
Check whether ``self`` and ``J`` are equivalent as right ideals.
Requires the underlying rational quaternion algebra to be definite.
INPUT:
Expand Down Expand Up @@ -3698,7 +3698,7 @@ def is_right_equivalent(self, J, B=10, certificate=False):

def is_principal(self, certificate=False):
r"""
Checks whether ``self`` is principal as a full rank quaternion ideal.
Check whether ``self`` is principal as a full rank quaternion ideal.
Requires the underlying quaternion algebra to be definite.
Independent of whether ``self`` is a left or a right ideal.
Expand Down
14 changes: 7 additions & 7 deletions src/sage/arith/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ def eratosthenes(n):
- ``n`` -- a positive integer
OUTPUT: a list of primes less than or equal to n
OUTPUT: list of primes less than or equal to n
EXAMPLES::
Expand Down Expand Up @@ -1660,7 +1660,7 @@ def __repr__(self):

def __call__(self, n, k=1):
"""
Computes the sum of (the k-th powers of) the divisors of n.
Compute the sum of (the `k`-th powers of) the divisors of `n`.
EXAMPLES::
Expand Down Expand Up @@ -4141,7 +4141,7 @@ def kronecker_symbol(x,y):
- ``y`` -- integer
OUTPUT: an integer
OUTPUT: integer
EXAMPLES::
Expand Down Expand Up @@ -4754,14 +4754,14 @@ def continuant(v, n=None):


def number_of_divisors(n):
"""
Return the number of divisors of the integer n.
r"""
Return the number of divisors of the integer `n`.
INPUT:
- ``n`` -- a nonzero integer
OUTPUT: an integer, the number of divisors of n
OUTPUT: integer; the number of divisors of `n`
EXAMPLES::
Expand Down Expand Up @@ -6013,7 +6013,7 @@ def fundamental_discriminant(D):
- ``D`` -- integer
OUTPUT: an integer, the fundamental discriminant
OUTPUT: integer; the fundamental discriminant
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/calculus/desolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ def desolve_rk4(de, dvar, ics=None, ivar=None, end_points=None, step=0.1, output
- if end_points is [a,b] we integrate between ``min(ics[0], a)`` and ``max(ics[0], b)``
- ``step`` -- (default:0.1) the length of the step (positive number)
- ``step`` -- (default: 0.1) the length of the step (positive number)
- ``output`` -- (default: ``'list'``) one of ``'list'``,
``'plot'``, ``'slope_field'`` (graph of the solution with slope field)
Expand Down
4 changes: 2 additions & 2 deletions src/sage/calculus/interpolators.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cdef double TWOPI = 2*pi

def polygon_spline(pts):
"""
Creates a polygon from a set of complex or `(x,y)` points. The polygon
Create a polygon from a set of complex or `(x,y)` points. The polygon
will be a parametric curve from 0 to 2*pi. The returned values will be
complex, not `(x,y)`.
Expand Down Expand Up @@ -168,7 +168,7 @@ cdef class PSpline:

def complex_cubic_spline(pts):
"""
Creates a cubic spline interpolated figure from a set of complex or
Create a cubic spline interpolated figure from a set of complex or
`(x,y)` points. The figure will be a parametric curve from 0 to 2*pi.
The returned values will be complex, not `(x,y)`.
Expand Down
4 changes: 2 additions & 2 deletions src/sage/calculus/riemann.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ cdef class Riemann_Map:
opp=False, exterior = False):

"""
Initializes the ``Riemann_Map`` class. See the class :class:`Riemann_Map`
Initialize the ``Riemann_Map`` class. See the class :class:`Riemann_Map`
for full documentation on the input of this initialization method.
TESTS::
Expand Down Expand Up @@ -1094,7 +1094,7 @@ cdef comp_pt(clist, loop=True):
cpdef get_derivatives(np.ndarray[COMPLEX_T, ndim=2] z_values, FLOAT_T xstep,
FLOAT_T ystep):
"""
Computes the r*e^(I*theta) form of derivatives from the grid of points. The
Compute the r*e^(I*theta) form of derivatives from the grid of points. The
derivatives are computed using quick-and-dirty taylor expansion and
assuming analyticity. As such ``get_derivatives`` is primarily intended
to be used for comparisons in ``plot_spiderweb`` and not for
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def __contains__(self, x):
@staticmethod
def __classcontains__(cls, x):
"""
Membership testing, without arguments
Membership testing, without arguments.
INPUT:
Expand Down Expand Up @@ -2940,7 +2940,7 @@ class JoinCategory(CategoryWithParameters):

def __init__(self, super_categories, **kwds):
"""
Initializes this JoinCategory.
Initialize this JoinCategory.
INPUT:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/commutative_rings.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def cyclotomic_cosets(self, q, cosets=None):
provided, the function only return the list of cosets that
contain some element from ``cosets``.
OUTPUT: a list of lists
OUTPUT: list of lists
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/coxeter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ def random_element_of_length(self, n):

def _test_simple_projections(self, **options):
"""
Runs sanity checks on :meth:`.simple_projections`
Run sanity checks on :meth:`.simple_projections`
and :meth:`CoxeterGroups.ElementMethods.apply_simple_projection`
EXAMPLES::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/crystals.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ def __iter__(self, index_set=None, max_depth=float('inf')):
INPUT:
- ``index_set`` -- (Default: ``None``) the index set; if ``None``
- ``index_set`` -- (default: ``None``) the index set; if ``None``
then use the index set of the crystal
- ``max_depth`` -- (Default: infinity) the maximum depth to build
- ``max_depth`` -- (default: infinity) the maximum depth to build
The iteration order is not specified except that, if
``max_depth`` is finite, then the iteration goes depth by
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/enumerated_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def map(self, f, name=None, *, is_injective=True):
#
def _test_enumerated_set_contains(self, **options):
"""
Checks that the methods :meth:`.__contains__` and :meth:`.__iter__` are consistent.
Check that the methods :meth:`.__contains__` and :meth:`.__iter__` are consistent.
See also :class:`TestSuite`.
Expand Down Expand Up @@ -1039,7 +1039,7 @@ def _test_enumerated_set_contains(self, **options):

def _test_enumerated_set_iter_list(self, **options):
"""
Checks that the methods :meth:`.list` and :meth:`.__iter__` are consistent.
Check that the methods :meth:`.list` and :meth:`.__iter__` are consistent.
See also: :class:`TestSuite`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def degree_on_basis(self, m):
- ``m`` -- an element of the free abelian monoid
OUTPUT: an integer, the degree of the corresponding basis element
OUTPUT: integer; the degree of the corresponding basis element
EXAMPLES::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def degree_on_basis(self, t):
- ``t`` -- the index of an element of the basis of this module,
i.e. a partition
OUTPUT: an integer, the degree of the corresponding basis element
OUTPUT: integer; the degree of the corresponding basis element
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/graded_modules_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def degree_on_basis(self, t):
- ``t`` -- the index of an element of the basis of this module,
i.e. a partition
OUTPUT: an integer, the degree of the corresponding basis element
OUTPUT: integer, the degree of the corresponding basis element
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/sets_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def an_element(self):

def _element_constructor_(self, i):
"""
Constructs an element of self from an integer, testing that
Construct an element of self from an integer, testing that
this integer is indeed prime.
EXAMPLES::
Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/finite_complex_reflection_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,14 +838,14 @@ def absolute_order_ideal(self, gens=None,
Otherwise, the standard Coxeter element is used as unique
maximal element.
- ``in_unitary_group`` (default:``True``) determines the
- ``in_unitary_group`` -- (default: ``True``) determines the
length function used to compute the order.
For real groups, both possible orders coincide, and for
complex non-real groups, the order in the unitary group
is much faster to compute.
- ``return_lengths`` (default:``False``) whether or not
to also return the lengths of the elements.
- ``return_lengths`` -- (default: ``False``) whether or not
to also return the lengths of the elements
EXAMPLES::
Expand Down
Loading

0 comments on commit 5f652ff

Please sign in to comment.