Did I find the right examples for you? yes no

All Samples(308)  |  Call(288)  |  Derive(0)  |  Import(20)
Represents a morphism which has a name.

Names are used to distinguish between morphisms which have the
same domain and codomain: two named morphisms are equal if they
have the same domains, codomains, and names.

Examples
========

>>> from sympy.categories import Object, NamedMorphism(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
                # them the same names, we avoid unnecessary
                # duplicates.
                new_morphisms.append(NamedMorphism(dom, cod, "dummy"))
 
        # Lay out the new diagram.  Since these are dummy 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
                # them the same names, we avoid unnecessary
                # duplicates.
                new_morphisms.append(NamedMorphism(dom, cod, "dummy"))
 
        # Lay out the new diagram.  Since these are dummy morphisms,

src/s/y/sympy-0.7.5/sympy/printing/pretty/pretty.py   sympy(Download)
    def _print_IdentityMorphism(self, morphism):
        from sympy.categories import NamedMorphism
        return self._print_NamedMorphism(
            NamedMorphism(morphism.domain, morphism.codomain, "id"))
 

src/s/y/sympy-HEAD/sympy/printing/pretty/pretty.py   sympy(Download)
    def _print_IdentityMorphism(self, morphism):
        from sympy.categories import NamedMorphism
        return self._print_NamedMorphism(
            NamedMorphism(morphism.domain, morphism.codomain, "id"))
 

src/s/y/sympy-0.7.5/sympy/printing/latex.py   sympy(Download)
    def _print_IdentityMorphism(self, morphism):
        from sympy.categories import NamedMorphism
        return self._print_NamedMorphism(NamedMorphism(
            morphism.domain, morphism.codomain, "id"))
 

src/s/y/sympy-HEAD/sympy/printing/latex.py   sympy(Download)
    def _print_IdentityMorphism(self, morphism):
        from sympy.categories import NamedMorphism
        return self._print_NamedMorphism(NamedMorphism(
            morphism.domain, morphism.codomain, "id"))
 

src/s/y/sympy-0.7.5/sympy/categories/tests/test_drawing.py   sympy(Download)
from sympy.categories.diagram_drawing import _GrowableGrid, ArrowStringDescription
from sympy.categories import (DiagramGrid, Object, NamedMorphism,
                              Diagram, XypicDiagramDrawer, xypic_draw_diagram)
from sympy import FiniteSet
 
    E = Object("E")
 
    f = NamedMorphism(A, B, "f")
    g = NamedMorphism(B, C, "g")
    h = NamedMorphism(D, A, "h")
    k = NamedMorphism(D, B, "k")

src/s/y/sympy-HEAD/sympy/categories/tests/test_drawing.py   sympy(Download)
from sympy.categories.diagram_drawing import _GrowableGrid, ArrowStringDescription
from sympy.categories import (DiagramGrid, Object, NamedMorphism,
                              Diagram, XypicDiagramDrawer, xypic_draw_diagram)
from sympy import FiniteSet
 
    E = Object("E")
 
    f = NamedMorphism(A, B, "f")
    g = NamedMorphism(B, C, "g")
    h = NamedMorphism(D, A, "h")
    k = NamedMorphism(D, B, "k")

src/s/y/sympy-HEAD/sympy/core/tests/test_args.py   sympy(Download)
def test_sympy__categories__baseclasses__NamedMorphism():
    from sympy.categories import Object, NamedMorphism
    assert _test_args(NamedMorphism(Object("A"), Object("B"), "f"))
 
 
def test_sympy__categories__baseclasses__CompositeMorphism():
    from sympy.categories import Object, NamedMorphism, CompositeMorphism
    B = Object("B")
    C = Object("C")
    f = NamedMorphism(A, B, "f")
    g = NamedMorphism(B, C, "g")
    assert _test_args(CompositeMorphism(f, g))

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 the base morphism.
    f = NamedMorphism(A, B, "f")
    assert f.domain == A
    assert f.codomain == B
    assert f == NamedMorphism(A, B, "f")
 
    # Test named morphisms.
    g = NamedMorphism(B, C, "g")
    assert g.name == "g"
    assert g != f
    assert g == NamedMorphism(B, C, "g")

  1 | 2  Next