Did I find the right examples for you? yes no

All Samples(32)  |  Call(21)  |  Derive(0)  |  Import(11)
Represents an identity morphism.

An identity morphism is a morphism with equal domain and codomain,
which acts as an identity with respect to composition.

Examples
========

>>> from sympy.categories import Object, NamedMorphism, IdentityMorphism
>>> A = Object("A")(more...)

src/s/y/sympy-0.7.5/sympy/categories/diagram_drawing.py   sympy(Download)
 
from sympy.core import Basic, FiniteSet, Dict, Symbol
from sympy.categories import (CompositeMorphism, IdentityMorphism,
                              NamedMorphism, Diagram)
from sympy.utilities import default_sort_key
                # Let's add an identity morphism, for the sake of
                # surely having morphisms in this component.
                current_morphisms[IdentityMorphism(component[0])] = FiniteSet()
 
            component_morphisms.append(Diagram(current_morphisms))

src/s/y/sympy-HEAD/sympy/categories/diagram_drawing.py   sympy(Download)
 
from sympy.core import Basic, FiniteSet, Dict, Symbol
from sympy.categories import (CompositeMorphism, IdentityMorphism,
                              NamedMorphism, Diagram)
from sympy.utilities import default_sort_key
                # Let's add an identity morphism, for the sake of
                # surely having morphisms in this component.
                current_morphisms[IdentityMorphism(component[0])] = FiniteSet()
 
            component_morphisms.append(Diagram(current_morphisms))

src/s/y/sympy-0.7.5/sympy/categories/tests/test_baseclasses.py   sympy(Download)
from sympy.categories import (Object, Morphism, IdentityMorphism,
                              NamedMorphism, CompositeMorphism,
                              Diagram, Category)
from sympy.categories.baseclasses import Class
from sympy.utilities.pytest import XFAIL, raises
 
    # Test identities.
    id_A = IdentityMorphism(A)
    id_B = IdentityMorphism(B)
    assert id_A.domain == A
    assert id_A.codomain == A
    assert id_A == IdentityMorphism(A)
    f = NamedMorphism(A, B, "f")
    g = NamedMorphism(B, C, "g")
    id_A = IdentityMorphism(A)
    id_B = IdentityMorphism(B)
 

src/s/y/sympy-HEAD/sympy/categories/tests/test_baseclasses.py   sympy(Download)
from sympy.categories import (Object, Morphism, IdentityMorphism,
                              NamedMorphism, CompositeMorphism,
                              Diagram, Category)
from sympy.categories.baseclasses import Class
from sympy.utilities.pytest import XFAIL, raises
 
    # Test identities.
    id_A = IdentityMorphism(A)
    id_B = IdentityMorphism(B)
    assert id_A.domain == A
    assert id_A.codomain == A
    assert id_A == IdentityMorphism(A)
    f = NamedMorphism(A, B, "f")
    g = NamedMorphism(B, C, "g")
    id_A = IdentityMorphism(A)
    id_B = IdentityMorphism(B)
 

src/s/y/sympy-HEAD/sympy/core/tests/test_args.py   sympy(Download)
def test_sympy__categories__baseclasses__IdentityMorphism():
    from sympy.categories import Object, IdentityMorphism
    assert _test_args(IdentityMorphism(Object("A")))
 
 

src/s/y/sympy-0.7.5/sympy/printing/pretty/tests/test_pretty.py   sympy(Download)
def test_categories():
    from sympy.categories import (Object, IdentityMorphism,
        NamedMorphism, Category, Diagram, DiagramGrid)
 
    A1 = Object("A1")
    f1 = NamedMorphism(A1, A2, "f1")
    f2 = NamedMorphism(A2, A3, "f2")
    id_A1 = IdentityMorphism(A1)
 
    K1 = Category("K1")

src/s/y/sympy-HEAD/sympy/printing/pretty/tests/test_pretty.py   sympy(Download)
def test_categories():
    from sympy.categories import (Object, IdentityMorphism,
        NamedMorphism, Category, Diagram, DiagramGrid)
 
    A1 = Object("A1")
    f1 = NamedMorphism(A1, A2, "f1")
    f2 = NamedMorphism(A2, A3, "f2")
    id_A1 = IdentityMorphism(A1)
 
    K1 = Category("K1")

src/s/y/sympy-0.7.5/sympy/printing/tests/test_latex.py   sympy(Download)
def test_categories():
    from sympy.categories import (Object, IdentityMorphism,
        NamedMorphism, Category, Diagram, DiagramGrid)
 
    A1 = Object("A1")
    f1 = NamedMorphism(A1, A2, "f1")
    f2 = NamedMorphism(A2, A3, "f2")
    id_A1 = IdentityMorphism(A1)
 
    K1 = Category("K1")

src/s/y/sympy-HEAD/sympy/printing/tests/test_latex.py   sympy(Download)
def test_categories():
    from sympy.categories import (Object, IdentityMorphism,
        NamedMorphism, Category, Diagram, DiagramGrid)
 
    A1 = Object("A1")
    f1 = NamedMorphism(A1, A2, "f1")
    f2 = NamedMorphism(A2, A3, "f2")
    id_A1 = IdentityMorphism(A1)
 
    K1 = Category("K1")

src/s/y/sympy-0.7.5/sympy/printing/tests/test_str.py   sympy(Download)
def test_categories():
    from sympy.categories import (Object, NamedMorphism,
        IdentityMorphism, Category)
 
    A = Object("A")
    B = Object("B")
 
    f = NamedMorphism(A, B, "f")
    id_A = IdentityMorphism(A)

  1 | 2  Next