From be5851f1975792161018cff63f15154fe600bcaf Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Tue, 12 Jul 2022 14:48:06 -0700 Subject: [PATCH 1/2] trac 34168: fix docstring markup for src/categories --- src/sage/categories/affine_weyl_groups.py | 2 +- src/sage/categories/category.py | 2 +- src/sage/categories/facade_sets.py | 6 ++++-- src/sage/categories/fields.py | 2 +- src/sage/categories/finite_coxeter_groups.py | 4 ++-- src/sage/categories/hecke_modules.py | 2 +- src/sage/categories/integral_domains.py | 2 +- src/sage/categories/rings.py | 2 +- src/sage/categories/unique_factorization_domains.py | 6 +++--- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/sage/categories/affine_weyl_groups.py b/src/sage/categories/affine_weyl_groups.py index 37dc4a2c9dc..285fe9e45ab 100644 --- a/src/sage/categories/affine_weyl_groups.py +++ b/src/sage/categories/affine_weyl_groups.py @@ -19,7 +19,7 @@ class AffineWeylGroups(Category_singleton): """ The category of affine Weyl groups - .. todo:: add a description of this category + .. TODO:: add a description of this category .. SEEALSO:: diff --git a/src/sage/categories/category.py b/src/sage/categories/category.py index a52b95dda00..b69475b67fe 100644 --- a/src/sage/categories/category.py +++ b/src/sage/categories/category.py @@ -1392,7 +1392,7 @@ def _test_category_graph(self, **options): method resolution order of the parent and element classes. This method checks this. - .. todo:: currently, this won't work for hom categories. + .. TODO:: currently, this won't work for hom categories. EXAMPLES:: diff --git a/src/sage/categories/facade_sets.py b/src/sage/categories/facade_sets.py index 0e36e2875e9..0ddebfe30d2 100644 --- a/src/sage/categories/facade_sets.py +++ b/src/sage/categories/facade_sets.py @@ -186,8 +186,10 @@ def __contains__(self, element): Returns whether ``element`` is in one of the parents ``self`` is a facade for. - .. warning:: this default implementation is currently - overridden by :meth:`Parent.__contains__`. + .. warning:: + + this default implementation is currently + overridden by :meth:`Parent.__contains__`. EXAMPLES:: diff --git a/src/sage/categories/fields.py b/src/sage/categories/fields.py index 9148d51832c..3dad6f9946d 100644 --- a/src/sage/categories/fields.py +++ b/src/sage/categories/fields.py @@ -76,7 +76,7 @@ def __contains__(self, x): This implementation will not be needed anymore once every field in Sage will be properly declared in the category - :class:`Fields`(). + :class:`Fields`. Caveat: this should eventually be fixed:: diff --git a/src/sage/categories/finite_coxeter_groups.py b/src/sage/categories/finite_coxeter_groups.py index f799a79a274..24553fadaf0 100644 --- a/src/sage/categories/finite_coxeter_groups.py +++ b/src/sage/categories/finite_coxeter_groups.py @@ -202,7 +202,7 @@ def bruhat_poset(self, facade=False): sage: [len(WeylGroup(["A", n]).bruhat_poset().cover_relations()) for n in [1,2,3]] [1, 8, 58] - .. todo:: + .. TODO:: - Use the symmetric group in the examples (for nicer output), and print the edges for a stronger test. @@ -464,7 +464,7 @@ def weak_poset(self, side="right", facade=False): sage: [len(WeylGroup(["A", n]).weak_poset(side = "left" ).cover_relations()) for n in [1,2,3]] [1, 6, 36] - .. todo:: + .. TODO:: - Use the symmetric group in the examples (for nicer output), and print the edges for a stronger test. diff --git a/src/sage/categories/hecke_modules.py b/src/sage/categories/hecke_modules.py index 65900348b15..06dcb99687d 100644 --- a/src/sage/categories/hecke_modules.py +++ b/src/sage/categories/hecke_modules.py @@ -109,7 +109,7 @@ def _Hom_(self, Y, category): INPUT: - ``Y`` -- an Hecke module - - ``category`` -- a subcategory of :class:`HeckeModules`() or None + - ``category`` -- a subcategory of :class:`HeckeModules` or None The sole purpose of this method is to construct the homset as a :class:`~sage.modular.hecke.homspace.HeckeModuleHomspace`. If diff --git a/src/sage/categories/integral_domains.py b/src/sage/categories/integral_domains.py index 9113d724a04..4f80ea1b5bf 100644 --- a/src/sage/categories/integral_domains.py +++ b/src/sage/categories/integral_domains.py @@ -58,7 +58,7 @@ def __contains__(self, x): This implementation will not be needed anymore once every field in Sage will be properly declared in the category - :class:`IntegralDomains`(). + :class:`IntegralDomains`. """ try: return self._contains_helper(x) or x.is_integral_domain() diff --git a/src/sage/categories/rings.py b/src/sage/categories/rings.py index c48c48e5e49..c41d1f4d8d8 100644 --- a/src/sage/categories/rings.py +++ b/src/sage/categories/rings.py @@ -386,7 +386,7 @@ def _Hom_(self, Y, category): INPUT: - ``Y`` -- a ring - - ``category`` -- a subcategory of :class:`Rings`() or None + - ``category`` -- a subcategory of :class:`Rings` or None The sole purpose of this method is to construct the homset as a :class:`~sage.rings.homset.RingHomset`. If diff --git a/src/sage/categories/unique_factorization_domains.py b/src/sage/categories/unique_factorization_domains.py index f7943cb0f0c..3d0f4598fa9 100644 --- a/src/sage/categories/unique_factorization_domains.py +++ b/src/sage/categories/unique_factorization_domains.py @@ -74,7 +74,7 @@ def __contains__(self, x): This implementation will not be needed anymore once every field in Sage will be properly declared in the category - :class:`UniqueFactorizationDomains`(). + :class:`UniqueFactorizationDomains`. """ try: return self._contains_helper(x) or x.is_unique_factorization_domain() @@ -221,7 +221,7 @@ def radical(self, *args, **kwds): This default implementation calls ``squarefree_decomposition`` if available, and ``factor`` otherwise. - .. seealso:: :meth:`squarefree_part` + .. SEEALSO:: :meth:`squarefree_part` EXAMPLES:: @@ -271,7 +271,7 @@ def squarefree_part(self): This default implementation calls ``squarefree_decomposition``. - .. seealso:: :meth:`radical` + .. SEEALSO:: :meth:`radical` EXAMPLES:: From 80d7f8f4047c999758a141ae2cea777c27d776f0 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Wed, 13 Jul 2022 13:13:43 -0700 Subject: [PATCH 2/2] trac 34168: more markup fixes for categories --- src/sage/categories/fields.py | 2 +- src/sage/categories/hecke_modules.py | 4 ++-- src/sage/categories/integral_domains.py | 2 +- src/sage/categories/rings.py | 6 +++--- src/sage/categories/unique_factorization_domains.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sage/categories/fields.py b/src/sage/categories/fields.py index 3dad6f9946d..0ea91e393ff 100644 --- a/src/sage/categories/fields.py +++ b/src/sage/categories/fields.py @@ -76,7 +76,7 @@ def __contains__(self, x): This implementation will not be needed anymore once every field in Sage will be properly declared in the category - :class:`Fields`. + :class:`Fields() `. Caveat: this should eventually be fixed:: diff --git a/src/sage/categories/hecke_modules.py b/src/sage/categories/hecke_modules.py index 06dcb99687d..aa2ce2aea7b 100644 --- a/src/sage/categories/hecke_modules.py +++ b/src/sage/categories/hecke_modules.py @@ -109,7 +109,8 @@ def _Hom_(self, Y, category): INPUT: - ``Y`` -- an Hecke module - - ``category`` -- a subcategory of :class:`HeckeModules` or None + - ``category`` -- a subcategory of :class:`HeckeModules() + ` or ``None`` The sole purpose of this method is to construct the homset as a :class:`~sage.modular.hecke.homspace.HeckeModuleHomspace`. If @@ -143,7 +144,6 @@ def _Hom_(self, Y, category): Traceback (most recent call last): ... TypeError: Category of Hecke modules over Finite Field of size 5 is not a subcategory of Category of Hecke modules over Rational Field - """ # TODO: double check that it's the correct HeckeModules category below: if category is not None and not category.is_subcategory(HeckeModules(self.base_ring())): diff --git a/src/sage/categories/integral_domains.py b/src/sage/categories/integral_domains.py index 4f80ea1b5bf..9daa68ff25e 100644 --- a/src/sage/categories/integral_domains.py +++ b/src/sage/categories/integral_domains.py @@ -58,7 +58,7 @@ def __contains__(self, x): This implementation will not be needed anymore once every field in Sage will be properly declared in the category - :class:`IntegralDomains`. + :class:`IntegralDomains() `. """ try: return self._contains_helper(x) or x.is_integral_domain() diff --git a/src/sage/categories/rings.py b/src/sage/categories/rings.py index c41d1f4d8d8..efac793478e 100644 --- a/src/sage/categories/rings.py +++ b/src/sage/categories/rings.py @@ -386,12 +386,13 @@ def _Hom_(self, Y, category): INPUT: - ``Y`` -- a ring - - ``category`` -- a subcategory of :class:`Rings` or None + - ``category`` -- a subcategory of :class:`Rings() + ` or ``None`` The sole purpose of this method is to construct the homset as a :class:`~sage.rings.homset.RingHomset`. If ``category`` is specified and is not a subcategory of - :class:`Rings`, a ``TypeError`` is raised instead + :class:`Rings() `, a ``TypeError`` is raised instead This method is not meant to be called directly. Please use :func:`sage.categories.homset.Hom` instead. @@ -412,7 +413,6 @@ def _Hom_(self, Y, category): sage: TestSuite(Hom(QQ, QQ, category = Rings())).run() # indirect doctest - """ if category is not None and not category.is_subcategory(Rings()): raise TypeError("%s is not a subcategory of Rings()"%category) diff --git a/src/sage/categories/unique_factorization_domains.py b/src/sage/categories/unique_factorization_domains.py index 3d0f4598fa9..49a41b97098 100644 --- a/src/sage/categories/unique_factorization_domains.py +++ b/src/sage/categories/unique_factorization_domains.py @@ -74,7 +74,7 @@ def __contains__(self, x): This implementation will not be needed anymore once every field in Sage will be properly declared in the category - :class:`UniqueFactorizationDomains`. + :class:`UniqueFactorizationDomains() `. """ try: return self._contains_helper(x) or x.is_unique_factorization_domain()