models Package¶
models Package¶
TOTO
AbcModel Module¶
-
class
mplotlab.models.AbcModel.AbcModel(**k)¶ Bases:
mplotlab.models.AbcType.ATypeAbstract class representing a model element. For derived class, use the parameter 'attributeInfos' to auto generate its properties
-
attributeInfos= [('name', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'name info'))]¶
-
classmethod
fromxml(et, **k)¶
-
getAttr(name)¶
-
getProperties()¶
-
static
getSubEt(clsname, parameter, model, et, **attr)¶
-
get_container()¶
-
get_id()¶
-
classmethod
populate(parameter, self, subEt, parseModel=False)¶
-
setAttr(name, value)¶ set the value of an attribute ex : self.setAttr("name",value)
-
update(**k)¶ update the model from dict arguments ex: self.update(name="toto",size=170)
-
-
class
mplotlab.models.AbcModel.MODELS¶ Bases:
mplotlab.models.AbcType.AType-
containerStaticClass¶ alias of
Container
-
classmethod
fromxml(et, **k)¶
-
classmethod
populate(name, abcModels, subEt, **k)¶
-
-
mplotlab.models.AbcModel.NewModelId()¶
AbcType Module¶
-
class
mplotlab.models.AbcType.AType¶ Bases:
object-
classmethod
fromstring(text, attr={}, **k)¶ Return the value from parsed unicode @param text: unicode
text of element tree- @param attr: dict
- element tree attributes
- @param k: dict
- optionnal attributes (for derived class)
@param object
-
classmethod
fromxml(et, **k)¶ Return the attribute value @param et: Element
element tree to decode- @param k: dict
- optionnal attributes (for derived class)
@param object example:
- if et represents:
- <INT name="width">200</INT>
INT.fromxml(et) -> 200
-
static
getSubEt(clsname, parameter, value, et, **attr)¶ Create a sub element for the attribute @param clsname: str
attribute class name- @param parameter: str
- parameter name
- @param et: ElementTree
- element tree to populate onto
- @param value: object
- attribute value
- @param attr: dict
- element tree child(s) attributes
@return ElementTree
-
classmethod
populate(parameter, value, subEt, **k)¶ Parse attribute value within the sub element @param parameter: str
parameter name- @param value: object
- attribute value
- @param subEt: ElementTree
- element tree dedicated to parse value
- @param k: dict
- optionnal attributes (for derived class)
-
classmethod
tostring(value, **k)¶ Return the attribute value parsed (unicode) @param value: object
attribute value- @param k: dict
- optionnal attributes (for derived class)
@return unicode
-
classmethod
toxml(parameter, value, et, attr={}, **k)¶ - @param parameter: str
- parameter name
- @param value: object
- attribute value
- @param et: ElementTree
- element tree to populate onto
- @param attr: dict
- element tree child attributes
- @param k: dict
- optionnal attributes (for derived class)
- example:
INT.toxml("width", 200, root) produces : <root>
(...) <INT name="width">200</INT></root>
-
typeClass¶ alias of
str
-
classmethod
-
class
mplotlab.models.AbcType.BOOL¶ Bases:
mplotlab.models.AbcType.AType-
classmethod
fromstring(text, **k)¶
-
classmethod
tostring(value, **k)¶
-
typeClass¶ alias of
bool
-
classmethod
-
class
mplotlab.models.AbcType.COLOR¶
-
class
mplotlab.models.AbcType.FLOAT¶ Bases:
mplotlab.models.AbcType.AType-
typeClass¶ alias of
float
-
-
class
mplotlab.models.AbcType.INT¶ Bases:
mplotlab.models.AbcType.AType-
typeClass¶ alias of
int
-
-
class
mplotlab.models.AbcType.STRING¶
Collection Module¶
-
class
mplotlab.models.Collection.Collection(**k)¶ Bases:
mplotlab.models.AbcModel.AbcModel-
attributeInfos= [('name', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'name info')), ('X', (<class 'mplotlab.models.Variable.Variable'>, <class 'mplotlab.models.Variable.Variable'>, <mplotlab.models.Variable.Variable object at 0x049B6FF0>, 'var X')), ('Y', (<class 'mplotlab.models.Variable.Variable'>, <class 'mplotlab.models.Variable.Variable'>, <mplotlab.models.Variable.Variable object at 0x049BD030>, 'var Y')), ('color', (<type 'str'>, <class 'mplotlab.models.AbcType.COLOR'>, 'blue', 'artist color')), ('linestyle', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '-', 'linestyle')), ('animation', (<type 'bool'>, <class 'mplotlab.models.AbcType.BOOL'>, False, 'enable artist animation'))]¶
-
Container Module¶
-
class
mplotlab.models.Container.Container¶ Bases:
object-
MODELCLASSES= [<class 'mplotlab.models.Source.Source'>, <class 'mplotlab.models.Variable.Variable'>, <class 'mplotlab.models.Collection.Collection'>, <class 'mplotlab.models.Projection.Projection'>, <class 'mplotlab.models.Slide.Slide'>]¶
-
REGCLASSES= {'Container': <class 'mplotlab.models.Container.Container'>, 'STRING': <class 'mplotlab.models.AbcType.STRING'>, 'Source': <class 'mplotlab.models.Source.Source'>, 'COLOR': <class 'mplotlab.models.AbcType.COLOR'>, 'SourceExpression': <class 'mplotlab.models.Source.SourceExpression'>, 'FLOAT': <class 'mplotlab.models.AbcType.FLOAT'>, 'Collection': <class 'mplotlab.models.Collection.Collection'>, 'SourceSocket': <class 'mplotlab.models.Source.SourceSocket'>, 'MODELS': <class 'mplotlab.models.AbcModel.MODELS'>, 'INT': <class 'mplotlab.models.AbcType.INT'>, 'Slide': <class 'mplotlab.models.Slide.Slide'>, 'BOOL': <class 'mplotlab.models.AbcType.BOOL'>, 'AbcModel': <class 'mplotlab.models.AbcModel.AbcModel'>, 'Variable': <class 'mplotlab.models.Variable.Variable'>, 'NDARRAY': <class 'mplotlab.models.Source.NDARRAY'>, 'Projection': <class 'mplotlab.models.Projection.Projection'>}¶
-
delete(model)¶
-
flush()¶
-
fromxml(filename)¶
-
classmethod
getAType(name)¶
-
getCollections()¶
-
getModel(m_id)¶
-
getProjections()¶
-
getSlides()¶
-
getSources()¶
-
getVariables()¶
-
hasModel(m_id)¶
-
register(model)¶
-
classmethod
registerAType(*clsL)¶
-
toxml(filename)¶
-
Projection Module¶
-
class
mplotlab.models.Projection.Projection(**k)¶ Bases:
mplotlab.models.AbcModel.AbcModel-
attributeInfos= [('name', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'name info')), ('collections', (<type 'list'>, <class 'mplotlab.models.AbcModel.MODELS'>, [], 'collections')), ('xlabel', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'axes xlabel')), ('ylabel', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'axes ylabel')), ('autolim', (<type 'bool'>, <class 'mplotlab.models.AbcType.BOOL'>, False, "Auto lim axis. Doesn't use x,y min/max")), ('xmin', (<type 'float'>, <class 'mplotlab.models.AbcType.FLOAT'>, 0.0, 'axes xmin')), ('xmax', (<type 'float'>, <class 'mplotlab.models.AbcType.FLOAT'>, 5.0, 'axes xmax')), ('ymin', (<type 'float'>, <class 'mplotlab.models.AbcType.FLOAT'>, 0.0, 'axes ymin')), ('ymax', (<type 'float'>, <class 'mplotlab.models.AbcType.FLOAT'>, 5.0, 'axes ymax'))]¶
-
Slide Module¶
-
class
mplotlab.models.Slide.Slide(**k)¶ Bases:
mplotlab.models.AbcModel.AbcModel-
attributeInfos= [('name', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'name info')), ('title', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'figure title')), ('projections', (<type 'list'>, <class 'mplotlab.models.AbcModel.MODELS'>, [], 'projections'))]¶
-
Source Module¶
-
class
mplotlab.models.Source.NDARRAY¶ Bases:
mplotlab.models.AbcType.AType-
classmethod
fromstring(*a, **k)¶
-
classmethod
toxml(*a, **k)¶ values aren't serialized as any parameter. They are generated from source handlers such as expression, files or remote data streams
-
classmethod
-
class
mplotlab.models.Source.Source(*a, **k)¶ Bases:
mplotlab.models.AbcModel.AbcModel-
attributeInfos= [('name', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'name info')), ('values', (<type 'numpy.ndarray'>, <class 'mplotlab.models.Source.NDARRAY'>, array([], dtype=float64), 'values to address to many variables'))]¶
-
getSourceData()¶
-
init()¶
-
isInit()¶
-
stop()¶
-
-
class
mplotlab.models.Source.SourceExpression(*a, **k)¶ Bases:
mplotlab.models.Source.Source-
attributeInfos= [('name', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'name info')), ('values', (<type 'numpy.ndarray'>, <class 'mplotlab.models.Source.NDARRAY'>, array([], dtype=float64), 'values to address to many variables')), ('expression', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'expression that returns a numpy array'))]¶
-
init()¶ Initialize values
-
-
class
mplotlab.models.Source.SourceSocket(*a, **k)¶ Bases:
mplotlab.models.Source.Source-
attributeInfos= [('name', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'name info')), ('values', (<type 'numpy.ndarray'>, <class 'mplotlab.models.Source.NDARRAY'>, array([], dtype=float64), 'values to address to many variables')), ('host', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, 'localhost', 'host used to configure the socket connection')), ('port', (<type 'int'>, <class 'mplotlab.models.AbcType.INT'>, 50981, 'host used to configure the socket connection')), ('buffsize', (<type 'int'>, <class 'mplotlab.models.AbcType.INT'>, 9999999, 'buffer size')), ('period', (<type 'int'>, <class 'mplotlab.models.AbcType.INT'>, 50, 'polling period in ms'))]¶
-
cbThread()¶
-
handleMessage(message)¶
-
init()¶ Initialize values
-
Variable Module¶
-
class
mplotlab.models.Variable.Variable(**k)¶ Bases:
mplotlab.models.AbcModel.AbcModel-
applyFormula(sourceValues)¶ @param sourceValues : np.array @param sources : dict
ex : {'T':<numpyarray>}
-
attributeInfos= [('name', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', 'name info')), ('source', (<class 'mplotlab.models.Source.Source'>, <class 'mplotlab.models.Source.Source'>, <mplotlab.models.Source.Source object at 0x049B6BD0>, 'data')), ('formula', (<type 'str'>, <class 'mplotlab.models.AbcType.STRING'>, '', "formula to compose with other variable data (ex: 'sin(T)' with 'T' a source name)It uses numpy expressions"))]¶
-
getVariableData()¶
-