Permalink
Browse files

In Category, rename commutative to commutative_diagrams.

The second name is definitely more descriptive, and now that it's not
only me who thinks this it's OK to have long names, this commit changes
everything to use the new name.
  • Loading branch information...
1 parent 813eeb7 commit 47403e47eaef64ea702b3929a1ca901365647a3d @scolobb committed Jun 12, 2012
Showing with 11 additions and 11 deletions.
  1. +8 −8 sympy/categories/baseclasses.py
  2. +2 −2 sympy/categories/tests/test_baseclasses.py
  3. +1 −1 sympy/core/tests/test_args.py
@@ -526,7 +526,7 @@ class Category(Basic):
Certain instances of :class:`Diagram` can be asserted to be
commutative in a :class:`Category` by supplying the argument
- ``commutative`` in the constructor.
+ ``commutative_diagrams`` in the constructor.
Examples
========
@@ -539,20 +539,20 @@ class Category(Basic):
>>> f = Morphism(A, B, "f")
>>> g = Morphism(B, C, "g")
>>> d = Diagram([f, g])
- >>> K = Category("K", commutative=[d])
- >>> K.commutative == FiniteSet(d)
+ >>> K = Category("K", commutative_diagrams=[d])
+ >>> K.commutative_diagrams == FiniteSet(d)
True
See Also
========
Diagram
"""
- def __new__(cls, name, objects=EmptySet(), commutative=EmptySet()):
+ def __new__(cls, name, objects=EmptySet(), commutative_diagrams=EmptySet()):
if not name:
raise ValueError("A Category cannot have an empty name.")
new_category = Basic.__new__(cls, Symbol(name), Class(objects),
- FiniteSet(commutative))
+ FiniteSet(commutative_diagrams))
return new_category
@property
@@ -591,7 +591,7 @@ def objects(self):
return self.args[1]
@property
- def commutative(self):
+ def commutative_diagrams(self):
"""
Returns the :class:`FiniteSet` of diagrams which are known to
be commutative in this category.
@@ -604,8 +604,8 @@ def commutative(self):
>>> f = Morphism(A, B, "f")
>>> g = Morphism(B, C, "g")
>>> d = Diagram([f, g])
- >>> K = Category("K", commutative=[d])
- >>> K.commutative == FiniteSet(d)
+ >>> K = Category("K", commutative_diagrams=[d])
+ >>> K.commutative_diagrams == FiniteSet(d)
True
"""
@@ -183,7 +183,7 @@ def test_category():
objects = d1.objects | d2.objects
- K = Category("K", objects, commutative=[d1, d2])
+ K = Category("K", objects, commutative_diagrams=[d1, d2])
assert K.objects == Class(objects)
- assert K.commutative == FiniteSet(d1, d2)
+ assert K.commutative_diagrams == FiniteSet(d1, d2)
@@ -1972,5 +1972,5 @@ def test_sympy__categories__baseclasses__Category():
g = Morphism(B, C, "g")
d1 = Diagram([f, g])
d2 = Diagram([f])
- K = Category("K", commutative=[d1, d2])
+ K = Category("K", commutative_diagrams=[d1, d2])
assert _test_args(K)

0 comments on commit 47403e4

Please sign in to comment.