Ticket #10193: trac_10193-graded_sets-more_doc-vd.patch

File trac_10193-graded_sets-more_doc-vd.patch, 2.8 KB (added by vdelecroix, 5 years ago)
  • doc/en/reference/categories/index.rst

    # HG changeset patch
    # User Vincent Delecroix <20100.delecroix at gmail.com>
    # Date 1370111480 -7200
    # Node ID fd406f143ab76968c02abde454d03d325b733945
    # Parent  61da1546218b873d0909365e3bcbb4c9c8ef5baf
    trac 10193: documentation issues
      - improve the main docstring of the category SetsWithGrading
      - add the example in the documentation
    diff --git a/doc/en/reference/categories/index.rst b/doc/en/reference/categories/index.rst
    a b  
    162162   sage/categories/examples/semigroups
    163163   sage/categories/examples/semigroups_cython
    164164   sage/categories/examples/sets_cat
     165   sage/categories/examples/sets_with_grading
    165166   sage/categories/examples/with_realizations
  • sage/categories/examples/sets_with_grading.py

    diff --git a/sage/categories/examples/sets_with_grading.py b/sage/categories/examples/sets_with_grading.py
    a b  
    2 An example of graded set: non-negative integers graded by themselves.
     2Examples of a set with grading
    55from sage.structure.parent import Parent
  • sage/categories/sets_with_grading.py

    diff --git a/sage/categories/sets_with_grading.py b/sage/categories/sets_with_grading.py
    a b  
    3131    sets. The *grading* function maps each element `s` of
    3232    `S` to its *grade* `i`, so that `s\in S_i`.
    34     From implementation point of view, if the graded set is enumerated then
    35     each graded component should be enumerated (there is a check in the method
    36     :meth:`~SetsWithGrading.ParentMethods._test_graded_components`). The
    37     contrary needs not be true.
    39     To implement this category, a parent must either implement
     34    A parent with this category must either implement
    4035    :meth:`~SetsWithGrading.ParentMethods.graded_component()` or
    4136    :meth:`~SetsWithGrading.ParentMethods.subset()`. The first argument to
    4237    :meth:`~SetsWithGrading.ParentMethods.subset()` must be the grading for
    4338    compatibility with
    44     :meth:`~SetsWithGrading.ParentMethods.graded_component()` if both methods
    45     are not implemented. Additionally either the parent must implement
    46     :meth:`~SetsWithGrading.ParentMethods.grading()` or its elements will need
    47     a method ``grade()``.
     39    :meth:`~SetsWithGrading.ParentMethods.graded_component()`.
     40    Additionally either the parent must implement
     41    :meth:`~SetsWithGrading.ParentMethods.grading()` or its elements must
     42    a method ``grade()``. See the example in
     43    :class:`sage.categories.examples.sets_with_grading.NonNegativeIntegers`)
     45    Finally, if the graded set is enumerated (see
     46    :class:`~sage.categories.enumerated_sets.EnumeratedSets`) then each graded
     47    component should be enumerated. The contrary needs not be true.
    4949    EXAMPLES: