Skip to content

Commit

Permalink
Docstring edits
Browse files Browse the repository at this point in the history
Remove excessive blank lines around INPUT, OUTPUT, EXAMPLES, and before
docstring ending """. (#2)
  • Loading branch information
gmou3 committed Jun 13, 2024
1 parent 33550bd commit d41de45
Show file tree
Hide file tree
Showing 105 changed files with 0 additions and 357 deletions.
3 changes: 0 additions & 3 deletions src/sage/categories/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def __contains__(self, x):
sage: _ = gc.collect()
sage: len([X for X in gc.get_objects() if isinstance(X, sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic)]) - n
0
"""
from sage.rings.ring import _is_Field
try:
Expand Down Expand Up @@ -154,7 +153,6 @@ def _contains_helper(cls):
True
sage: F._contains_helper(Q)
True
"""
return Category_contains_method_by_parent_class(cls())

Expand Down Expand Up @@ -407,7 +405,6 @@ def is_perfect(self):
True
sage: FunctionField(GF(2), 'x').is_perfect()
False
"""
if self.characteristic() == 0:
return True
Expand Down
2 changes: 0 additions & 2 deletions src/sage/categories/finite_coxeter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ def inversion_sequence(self, word):
sage: [t.reduced_word() for t in CoxeterGroup(["A",3]).inversion_sequence([2,1,3,2,1,3])]
[[2], [1, 2, 1], [2, 3, 2], [1, 2, 3, 2, 1], [3], [1]]
"""
return [self.from_reduced_word(word[:i+1]+list(reversed(word[:i])))
for i in range(len(word))]
Expand Down Expand Up @@ -741,7 +740,6 @@ def permutahedron(self, point=None, base_ring=None):
W = CoxeterGroup(['I',7])
p = W.permutahedron()
sphinx_plot(p)
"""
n = self.one().canonical_matrix().rank()
weights = self.fundamental_weights()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,5 @@ def extra_super_categories(self):
sage: C.FiniteDimensional()
Category of tensor products of
finite dimensional modules with basis over Integer Ring
"""
return [self.base_category()]
1 change: 0 additions & 1 deletion src/sage/categories/finite_lattice_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class FiniteLatticePosets(CategoryWithAxiom):
sage: C is FiniteLatticePosets().Finite()
True
sage: TestSuite(C).run()
"""

class ParentMethods:
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/finite_permutation_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ def profile(self, n, using_polya=True):
sage: D8 = DihedralGroup(8)
sage: D8.profile(4, using_polya=False)
8
"""

if using_polya:
Expand Down
4 changes: 0 additions & 4 deletions src/sage/categories/finite_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class FinitePosets(CategoryWithAxiom):
sage: C is Posets().Finite()
True
sage: TestSuite(C).run()
"""

class ParentMethods:
Expand Down Expand Up @@ -265,7 +264,6 @@ def is_poset_morphism(self, f, codomain):
Finite poset containing 0 elements
sage: P.is_poset_morphism(f, P)
True
"""
for x in self:
for y in self.upper_covers(x):
Expand Down Expand Up @@ -1475,7 +1473,6 @@ def rowmotion_orbits_plots(self):
sage: P = Poset({})
sage: P.rowmotion_orbits_plots()
Graphics Array of size 1 x 1
"""
from sage.plot.plot import graphics_array
plot_of_orb_plots = []
Expand Down Expand Up @@ -1562,7 +1559,6 @@ def toggling_orbits_plots(self, vs):
sage: P = Poset({})
sage: P.toggling_orbits_plots([])
Graphics Array of size 1 x 1
"""
from sage.plot.plot import graphics_array
plot_of_orb_plots = []
Expand Down
2 changes: 0 additions & 2 deletions src/sage/categories/finitely_generated_semigroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def extra_super_categories(self):
sage: Semigroups().FinitelyGenerated().extra_super_categories()
[Category of enumerated sets]
"""
return [EnumeratedSets()]

Expand Down Expand Up @@ -121,7 +120,6 @@ def succ_generators(self, side='twosided'):
('ca', 'cab', 'ca', 'cad')
sage: S.succ_generators("twosided" )(S('ca'))
('ac', 'bca', 'ca', 'dca', 'ca', 'cab', 'ca', 'cad')
"""
left = (side == "left" or side == "twosided")
right = (side == "right" or side == "twosided")
Expand Down
12 changes: 0 additions & 12 deletions src/sage/categories/functor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def _Functor_unpickle(Cl, D, domain, codomain):
True
sage: F.domain(), loads(dumps(F)).domain()
(Category of rings, Category of rings)
"""
F = Functor.__new__(Cl)
Functor.__init__(F, domain, codomain)
Expand Down Expand Up @@ -163,7 +162,6 @@ cdef class Functor(SageObject):
sage: F(f)(p)
(-a^2 - 2*a*b - b^2 + a + b)*t^2 + (a^2 + 2*a*b + b^2 - a - b)*t
- 4*a^2 - 8*a*b - 4*b^2 - a - b + 1
"""
def __init__(self, domain, codomain):
"""
Expand All @@ -177,7 +175,6 @@ cdef class Functor(SageObject):
Rational Field
sage: F(GF(2))
Finite Field of size 2
"""
if not isinstance(domain, category.Category):
raise TypeError("domain (=%s) must be a category" % domain)
Expand Down Expand Up @@ -234,7 +231,6 @@ cdef class Functor(SageObject):
sage: F = Functor(FiniteFields(), Fields())
sage: F._apply_functor(ZZ)
Rational Field
"""
return self.__codomain(x)

Expand Down Expand Up @@ -383,7 +379,6 @@ cdef class Functor(SageObject):
TypeError: Functor from Category of rings to Category of rings
is ill-defined, since it sends x (=Rational Field) to something
that is not in Category of rings.
"""
from sage.categories.morphism import Morphism
if isinstance(x, Morphism):
Expand All @@ -402,7 +397,6 @@ cdef class Functor(SageObject):
sage: F = ForgetfulFunctor(FiniteFields(), Fields())
sage: F.domain()
Category of finite enumerated fields
"""
return self.__domain

Expand All @@ -415,7 +409,6 @@ cdef class Functor(SageObject):
sage: F = ForgetfulFunctor(FiniteFields(), Fields())
sage: F.codomain()
Category of fields
"""
return self.__codomain

Expand Down Expand Up @@ -444,7 +437,6 @@ def is_Functor(x):
The forgetful functor from Category of fields to Category of rings
sage: is_Functor(F2)
True
"""
return isinstance(x, Functor)

Expand Down Expand Up @@ -472,7 +464,6 @@ class ForgetfulFunctor_generic(Functor):
to Category of fields
sage: F(GF(3))
Finite Field of size 3
"""
def __reduce__(self):
"""
Expand All @@ -492,7 +483,6 @@ class ForgetfulFunctor_generic(Functor):
sage: F # indirect doctest
The forgetful functor from Category of finite enumerated fields
to Category of fields
"""
return "The forgetful functor from %s to %s" % (self.domain(),
self.codomain())
Expand Down Expand Up @@ -586,7 +576,6 @@ class IdentityFunctor_generic(ForgetfulFunctor_generic):
True
sage: F
The identity functor on Category of groups
"""
ForgetfulFunctor_generic.__init__(self, C, C)

Expand Down Expand Up @@ -627,7 +616,6 @@ class IdentityFunctor_generic(ForgetfulFunctor_generic):
sage: F._apply_functor(ZZ)
Integer Ring
"""
return x

Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/graded_hopf_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def super_categories(self):
TESTS::
sage: TestSuite(GradedHopfAlgebrasWithBasis(QQ).WithRealizations()).run()
"""
from sage.categories.graded_hopf_algebras import GradedHopfAlgebras
R = self.base_category().base_ring()
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/groupoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def _make_named_class_key(self, name):
sage: Groupoid(DihedralGroup(3)).parent_class is Groupoid(ZZ).parent_class
True
"""
return None

Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ class provides even greater flexibility, including changing
AUTHOR:
- Rob Beezer (2010-03-15)
"""
from sage.matrix.operation_table import OperationTable
import operator
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/homsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ def base(self):
sage: ModulesWithBasis(ZZ).Homsets().base()
Integer Ring
"""
from sage.categories.category_types import Category_over_base
for C in self._all_super_categories_proper:
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/hopf_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ def _test_antipode(self, **options):
sage: s = SymmetricFunctions(QQ).schur() # needs sage.combinat sage.modules
sage: s._test_antipode() # needs lrcalc_python sage.combinat sage.modules
"""
tester = self._tester(**options)

Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/integral_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def _test_fraction_field(self, **options):
EXAMPLES::
sage: ZZ._test_fraction_field()
"""
tester = self._tester(**options)
try:
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/lambda_bracket_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class LambdaBracketAlgebras(Category_over_base_ring):
This is an abstract base category for Lie conformal algebras and
super Lie conformal algebras.
"""
@staticmethod
def __classcall_private__(cls, R, check=True):
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/lattice_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class LatticePosets(Category):
sage: C = LatticePosets()
sage: TestSuite(C).run()
"""
@cached_method
def super_categories(self):
Expand Down
2 changes: 0 additions & 2 deletions src/sage/categories/magmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,6 @@ def is_idempotent(self):
'x'
sage: x.is_idempotent()
True
"""
return self * self == self

Expand Down Expand Up @@ -1178,7 +1177,6 @@ def product_by_coercion(self, left, right):
sage: y = Out.an_element()
sage: Out.product(x, y)
Out[{}] + 4*Out[{1}] + 9*Out[{2}] + Out[{1, 2}]
"""
R = self.realization_of().a_realization()
return self(R(left) * R(right))
2 changes: 0 additions & 2 deletions src/sage/categories/magmatic_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def super_categories(self):
sage: from sage.categories.additive_semigroups import AdditiveSemigroups
sage: MA.is_subcategory((AdditiveSemigroups() & Magmas()).Distributive())
True
"""
R = self.base_ring()
# Note: The specifications impose `self` to be a subcategory
Expand Down Expand Up @@ -219,7 +218,6 @@ def _product_from_product_on_basis_multiply( self, left, right ):
sage: a, b, c = A.algebra_generators() # needs sage.combinat sage.modules
sage: A._product_from_product_on_basis_multiply(a*b + 2*c, a - b) # needs sage.combinat sage.modules
B[word: aba] - B[word: abb] + 2*B[word: ca] - 2*B[word: cb]
"""
return self.linear_combination((self.product_on_basis(mon_left, mon_right), coeff_left * coeff_right )
for (mon_left, coeff_left) in left.monomial_coefficients(copy=False).items()
Expand Down
2 changes: 0 additions & 2 deletions src/sage/categories/map.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,6 @@ cdef class FormalCompositeMap(Map):
Traceback (most recent call last):
...
IndexError: list index out of range
"""
return self.__list[i]

Expand Down Expand Up @@ -1932,7 +1931,6 @@ cdef class FormalCompositeMap(Map):
sage: f = QQ.hom(QQbar) * ZZ.hom(QQ) # needs sage.rings.number_field
sage: f.is_injective() # needs sage.rings.number_field
True
"""
try:
# we try the category first
Expand Down
3 changes: 0 additions & 3 deletions src/sage/categories/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,6 @@ def extra_super_categories(self):
sage: Modules(QQ).FiniteDimensional().TensorProducts().FiniteDimensional()
Category of tensor products of finite dimensional vector spaces
over Rational Field
"""
return [self.base_category()]

Expand Down Expand Up @@ -681,7 +680,6 @@ def module_morphism(self, *, function, category=None, codomain, **keywords):
2-dimensional vector space over the Rational Field
sage: neg(e[0])
Element -e_0 of the 2-dimensional vector space over the Rational Field
"""
# Make sure that we only create a module morphism, even if
# domain and codomain have more structure
Expand Down Expand Up @@ -717,7 +715,6 @@ def quotient(self, submodule, check=True, **kwds):
<bound method Rings.ParentMethods.quotient of
Tensor Algebra of Free module generated by {'a', 'b', 'c'}
over Rational Field>
"""
return self.quotient_module(submodule, check=check, **kwds)

Expand Down
4 changes: 0 additions & 4 deletions src/sage/categories/modules_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ class ModulesWithBasis(CategoryWithAxiom_over_base_ring):
0
sage: TestSuite(ModulesWithBasis(ZZ)).run()
"""

def _call_(self, x):
Expand Down Expand Up @@ -558,7 +557,6 @@ def module_morphism(self, on_basis=None, matrix=None, function=None,
Traceback (most recent call last):
...
ValueError: diagonal (=3) should be a function
"""
if len([x for x in [matrix, on_basis, function, diagonal] if x is not None]) != 1:
raise ValueError("module_morphism() takes exactly one option out of `matrix`, `on_basis`, `function`, `diagonal`")
Expand Down Expand Up @@ -1407,7 +1405,6 @@ def random_element(self, n=2):
sage: F = Foo(QQ, tuple(), category=C) # needs sage.modules
sage: F.random_element() == F.zero() # needs sage.modules
True
"""
indices = self.basis().keys()
a = self.zero()
Expand Down Expand Up @@ -2165,7 +2162,6 @@ def map_coefficients(self, f, new_base_ring=None):
0
sage: B['a'].map_coefficients(lambda c: GF(2)(c), QQ)
B['a']
"""
R = self.parent()
if isinstance(f, Map):
Expand Down
Loading

0 comments on commit d41de45

Please sign in to comment.