How to use the ring.Ring function in ring

To help you get started, we’ve selected a few ring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nrnhines / ringtest / ring.py View on Github external
def __init__(self, ncell, nbranch, ncompart, gidstart, types):

        if settings.usegap:
            self.sid_dend_start = settings.nring * ncell
            self.halfgap_list = []

        self.gids = []
        self.delay = 1
        self.ncell = int(ncell)
        self.gidstart = gidstart

        self.mkring(self.ncell, nbranch, ncompart, types)
        self.mkstim()

        Ring.counter += 1

        # show number of cells created
        import sys
        sys.stdout.write("%d\r" % Ring.counter)
        sys.stdout.flush()
github sagemath / sagelib / sage / rings / quotient_ring.py View on Github external
# check_default_category, is very expensive.
        # However, we don't just want to use the given category without mixing in
        # some quotient stuff - unless Parent.__init__ was called
        # previously, in which case the quotient ring stuff is just
        # a vaste of time. This is the case for FiniteField_prime_modn.
        if not self._is_category_initialized():
            if category is None:
                try:
                    commutative = R.is_commutative()
                except (AttributeError, NotImplementedError):
                    commutative = False
                if commutative:
                    category = check_default_category(_CommutativeRingsQuotients,category)
                else:
                    category = check_default_category(_RingsQuotients,category)
            ring.Ring.__init__(self, R.base_ring(), names=names, category=category)
        # self._populate_coercion_lists_([R]) # we don't want to do this, since subclasses will often implement improved coercion maps.
github sagemath / sagelib / sage / rings / quotient_ring.py View on Github external
sage: is_QuotientRing(S)
        True
        sage: is_QuotientRing(R)
        False

    """
    return isinstance(x, QuotientRing_nc)

from sage.categories.rings import Rings
_Rings = Rings()
_RingsQuotients = Rings().Quotients()
from sage.categories.commutative_rings import CommutativeRings
_CommutativeRingsQuotients = CommutativeRings().Quotients()
from sage.structure.category_object import check_default_category

class QuotientRing_nc(ring.Ring, sage.structure.parent_gens.ParentWithGens):
    """
    The quotient ring of `R` by a twosided ideal `I`.
    
    This base class is for rings that do not inherit from :class:`~sage.rings.ring.CommutativeRing`.
    Real life examples will be available with trac ticket #7797.

    For rings that *do* inherit from :class:`~sage.rings.ring.CommutativeRing`, we provide
    a subclass :class:`QuotientRing_generic`, for backwards compatibility.

    EXAMPLES::
    
        sage: R. = PolynomialRing(ZZ,'x')
        sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2])
        sage: S = R.quotient_ring(I); S
        Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 3*x + 4, x^2 + 1)
github blt / Harmony / client / src / solarsystem.py View on Github external
def create_rings(self):
	for i in xrange(5):
 	    rname = ['ring', `i`, '.xcf']
            self.rSprites.add(Ring((self.centerx, self.centery),
              			    i, ''.join (rname)))