Did I find the right examples for you? yes no

All Samples(16)  |  Call(10)  |  Derive(0)  |  Import(6)

src/c/o/cogent-1.5.3/cogent/parse/mage.py   cogent(Download)
#!/usr/bin/env python
"""Provides a parser to create a Kinemage object from a kinemage file
"""
import re
from cogent.format.mage import Kinemage,MageGroup,MageList,MagePoint,\
            other = rec[1:]
        if first.startswith('@kinemage'): #kinemage
            k = Kinemage()
            count = int(first.replace('@kinemage','').strip())
            k.Count = count

src/p/y/pycogent-HEAD/cogent/parse/mage.py   pycogent(Download)
#!/usr/bin/env python
"""Provides a parser to create a Kinemage object from a kinemage file
"""
import re
from cogent.format.mage import Kinemage,MageGroup,MageList,MagePoint,\
            other = rec[1:]
        if first.startswith('@kinemage'): #kinemage
            k = Kinemage()
            count = int(first.replace('@kinemage','').strip())
            k.Count = count

src/c/o/cogent-1.5.3/tests/test_format/test_mage.py   cogent(Download)
from copy import deepcopy
from cogent.util.unit_test import TestCase, main
from cogent.format.mage import MagePoint, MageList, MageGroup, MageHeader, \
    Kinemage, MagePointFromBaseFreqs
from cogent.core.usage import BaseUsage
        self.mg1 = MageGroup([self.ml],Label='z')
        self.mg2 = MageGroup([self.ml,self.ml],Label='b')
        self.kin = Kinemage(1)
        self.kin.Groups = [self.mg1,self.mg2]
 
    def test_init_empty(self):
        """Kinemage empty init should work, but refuse to print"""
        k = Kinemage()
    def test_init(self):
        """Kinemage should init with any of its usual fields"""
        k = Kinemage(1)
        self.assertEqual(str(k), '@kinemage 1')
        k.Header = '@perspective'
        m2 = MageGroup([l],Radius=0.02)
        mg = MageGroup([m1])
        k = Kinemage(Count=1,Groups=[mg,m2])
        res = k.toCartesian().fromCartesian()
        self.assertEqual(str(k),str(res))

src/p/y/pycogent-HEAD/tests/test_format/test_mage.py   pycogent(Download)
from copy import deepcopy
from cogent.util.unit_test import TestCase, main
from cogent.format.mage import MagePoint, MageList, MageGroup, MageHeader, \
    Kinemage, MagePointFromBaseFreqs
from cogent.core.usage import BaseUsage
        self.mg1 = MageGroup([self.ml],Label='z')
        self.mg2 = MageGroup([self.ml,self.ml],Label='b')
        self.kin = Kinemage(1)
        self.kin.Groups = [self.mg1,self.mg2]
 
    def test_init_empty(self):
        """Kinemage empty init should work, but refuse to print"""
        k = Kinemage()
    def test_init(self):
        """Kinemage should init with any of its usual fields"""
        k = Kinemage(1)
        self.assertEqual(str(k), '@kinemage 1')
        k.Header = '@perspective'
        m2 = MageGroup([l],Radius=0.02)
        mg = MageGroup([m1])
        k = Kinemage(Count=1,Groups=[mg,m2])
        res = k.toCartesian().fromCartesian()
        self.assertEqual(str(k),str(res))

src/p/y/pycogent-HEAD/tests/test_parse/test_mage.py   pycogent(Download)
from cogent.parse.mage import MageParser, MageGroupFromString,\
    MageListFromString, MagePointFromString
from cogent.format.mage import MagePoint, MageList, MageGroup, Kinemage
 
__author__ = "Sandra Smit"

src/c/o/cogent-1.5.3/tests/test_parse/test_mage.py   cogent(Download)
from cogent.parse.mage import MageParser, MageGroupFromString,\
    MageListFromString, MagePointFromString
from cogent.format.mage import MagePoint, MageList, MageGroup, Kinemage
 
__author__ = "Sandra Smit"