# 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


162  162  sage/categories/examples/semigroups 
163  163  sage/categories/examples/semigroups_cython 
164  164  sage/categories/examples/sets_cat 
 165  sage/categories/examples/sets_with_grading 
165  166  sage/categories/examples/with_realizations 
166  167  
167  168  Miscellaneous 
diff git a/sage/categories/examples/sets_with_grading.py b/sage/categories/examples/sets_with_grading.py
a

b


1  1  r""" 
2   An example of graded set: nonnegative integers graded by themselves. 
 2  Examples of a set with grading 
3  3  """ 
4  4  
5  5  from sage.structure.parent import Parent 
diff git a/sage/categories/sets_with_grading.py b/sage/categories/sets_with_grading.py
a

b


31  31  sets. The *grading* function maps each element `s` of 
32  32  `S` to its *grade* `i`, so that `s\in S_i`. 
33  33  
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. 
38   
39   To implement this category, a parent must either implement 
 34  A parent with this category must either implement 
40  35  :meth:`~SetsWithGrading.ParentMethods.graded_component()` or 
41  36  :meth:`~SetsWithGrading.ParentMethods.subset()`. The first argument to 
42  37  :meth:`~SetsWithGrading.ParentMethods.subset()` must be the grading for 
43  38  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`) 
 44  
 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. 
48  48  
49  49  EXAMPLES: 
50  50  