Browse files

Comply with PEP8 whitespace recommendations in writing dicts.

This commit fixes the whitespace after the colon in dicts.  Previously,
I would sometimes not write them.
  • Loading branch information...
1 parent 3e23f68 commit 2704fc52a6423f69e68e4ae713a3e692bff1fb4e @scolobb committed Aug 7, 2012
Showing with 16 additions and 16 deletions.
  1. +5 −5 sympy/categories/baseclasses.py
  2. +11 −11 sympy/categories/tests/test_baseclasses.py
View
10 sympy/categories/baseclasses.py
@@ -557,7 +557,7 @@ class Diagram(Basic):
>>> pprint(d.premises, use_unicode=False)
{g*f:A-->C: EmptySet(), id:A-->A: EmptySet(), id:B-->B: EmptySet(), id:C-->C:
EmptySet(), f:A-->B: EmptySet(), g:B-->C: EmptySet()}
- >>> d = Diagram([f, g], {g * f:"unique"})
+ >>> d = Diagram([f, g], {g * f: "unique"})
>>> pprint(d.conclusions)
{g*f:A-->C: {unique}}
@@ -667,7 +667,7 @@ def __new__(cls, *args):
True
>>> g * f in d.premises.keys()
True
- >>> d = Diagram([f, g], {g * f:"unique"})
+ >>> d = Diagram([f, g], {g * f: "unique"})
>>> d.conclusions[g * f]
{unique}
@@ -775,7 +775,7 @@ def conclusions(self):
True
>>> g * f in d.premises.keys()
True
- >>> d = Diagram([f, g], {g * f:"unique"})
+ >>> d = Diagram([f, g], {g * f: "unique"})
>>> d.conclusions[g * f] == FiniteSet("unique")
True
@@ -892,9 +892,9 @@ def subdiagram_from_objects(self, objects):
>>> C = Object("C")
>>> f = NamedMorphism(A, B, "f")
>>> g = NamedMorphism(B, C, "g")
- >>> d = Diagram([f, g], {f:"unique", g*f:"veryunique"})
+ >>> d = Diagram([f, g], {f: "unique", g*f: "veryunique"})
>>> d1 = d.subdiagram_from_objects(FiniteSet(A, B))
- >>> d1 == Diagram([f], {f:"unique"})
+ >>> d1 == Diagram([f], {f: "unique"})
True
"""
if not self.objects.subset(objects):
View
22 sympy/categories/tests/test_baseclasses.py
@@ -118,12 +118,12 @@ def test_diagram():
assert d1 != d2
assert hash(d1) == hash(d11)
- d11 = Diagram({f:"unique"})
+ d11 = Diagram({f: "unique"})
assert d1 != d11
# Make sure that (re-)adding composites (with new properties)
# works as expected.
- d = Diagram([f, g], {g * f:"unique"})
+ d = Diagram([f, g], {g * f: "unique"})
assert d.conclusions == Dict({g*f:FiniteSet("unique")})
# Check the hom-sets when there are premises and conclusions.
@@ -132,7 +132,7 @@ def test_diagram():
assert d.hom(A, C) == (FiniteSet(g * f), FiniteSet(g * f))
# Check how the properties of composite morphisms are computed.
- d = Diagram({f:["unique", "isomorphism"], g:"unique"})
+ d = Diagram({f: ["unique", "isomorphism"], g:"unique"})
assert d.premises[g * f] == FiniteSet("unique")
# Check that conclusion morphisms with new objects are not allowed.
@@ -146,7 +146,7 @@ def test_diagram():
assert d.objects == empty
# Check a SymPy Dict object.
- d = Diagram(Dict({f:FiniteSet("unique", "isomorphism"), g:"unique"}))
+ d = Diagram(Dict({f: FiniteSet("unique", "isomorphism"), g:"unique"}))
assert d.premises[g * f] == FiniteSet("unique")
# Check the addition of components of composite morphisms.
@@ -155,7 +155,7 @@ def test_diagram():
assert g in d.premises
# Check subdiagrams.
- d = Diagram([f, g], {g * f:"unique"})
+ d = Diagram([f, g], {g * f: "unique"})
d1 = Diagram([f])
assert d.is_subdiagram(d1)
@@ -165,21 +165,21 @@ def test_diagram():
assert not d.is_subdiagram(d1)
assert not d1.is_subdiagram(d)
- d1 = Diagram([f, g], {g * f:["unique", "something"]})
+ d1 = Diagram([f, g], {g * f: ["unique", "something"]})
assert not d.is_subdiagram(d1)
assert not d1.is_subdiagram(d)
- d = Diagram({f:"blooh"})
- d1 = Diagram({f:"bleeh"})
+ d = Diagram({f: "blooh"})
+ d1 = Diagram({f: "bleeh"})
assert not d.is_subdiagram(d1)
assert not d1.is_subdiagram(d)
- d = Diagram([f, g], {f:"unique", g*f:"veryunique"})
+ d = Diagram([f, g], {f: "unique", g * f: "veryunique"})
d1 = d.subdiagram_from_objects(FiniteSet(A, B))
- assert d1 == Diagram([f], {f:"unique"})
+ assert d1 == Diagram([f], {f: "unique"})
raises(ValueError, lambda: d.subdiagram_from_objects(FiniteSet(A, Object("D"))))
- raises(ValueError, lambda: Diagram({IdentityMorphism(A):"unique"}))
+ raises(ValueError, lambda: Diagram({IdentityMorphism(A): "unique"}))
def test_category():
A = Object("A")

0 comments on commit 2704fc5

Please sign in to comment.