Package esys :: Package escript :: Module modelframe :: Class ParameterSet
[hide private]
[frames] | no frames]

Class ParameterSet

    object --+    
             |    
LinkableObject --+
                 |
                ParameterSet
Known Subclasses:

A class which allows to emphasize attributes to be written and read to XML.

Leaves of an ESySParameters object can be:

Example for how to create an ESySParameters object:

p11=ParameterSet(gamma1=1.,gamma2=2.,gamma3=3.)
p1=ParameterSet(dim=2,tol_v=0.001,output_file="/tmp/u.%3.3d.dx",runFlag=True,parm11=p11)
parm=ParameterSet(parm1=p1,parm2=ParameterSet(alpha=Link(p11,"gamma1")))

This can be accessed as:

parm.parm1.gamma=0.
parm.parm1.dim=2
parm.parm1.tol_v=0.001
parm.parm1.output_file="/tmp/u.%3.3d.dx"
parm.parm1.runFlag=True
parm.parm1.parm11.gamma1=1.
parm.parm1.parm11.gamma2=2.
parm.parm1.parm11.gamma3=3.
parm.parm2.alpha=1. (value of parm.parm1.parm11.gamma1)
Instance Methods [hide private]
 
__delattr__(self, name)
Removes the attribute name.
 
__init__(self, parameters=[], **kwargs)
Creates a ParameterSet with given parameters.
 
__iter__(self)
Creates an iterator over the parameter and their values.
 
__repr__(self)
repr(x)
 
_parametersToDom(self, esysxml, node)
 
checkLinkTargets(self, models, hash)
Returns a set of tuples ("<self>(<name>)", <target model>) if the parameter <name> is linked to model <target model> but <target model> is not in the list of models.
 
declareParameter(self, **parameters)
Declares one or more new parameters and their initial value.
 
declareParameters(self, parameters)
Declares a set of parameters.
 
releaseParameters(self, name)
Removes parameter name from the parameters.
 
showParameters(self)
Returns a description of the parameters.
 
toDom(self, esysxml, node)
toDom method of Model class.
 
writeXML(self, ostream=<epydoc.docintrospecter._DevNull instance at 0xa69f38>)
Writes the object as an XML object into an output stream.

Inherited from LinkableObject: __getattr__, __setattr__, getAttributeObject, hasAttribute, trace

Inherited from object: __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
fromDom(cls, esysxml, node)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__delattr__(self, name)

 
Removes the attribute name.
Overrides: object.__delattr__

__init__(self, parameters=[], **kwargs)
(Constructor)

 
Creates a ParameterSet with given parameters.
Overrides: object.__init__

__repr__(self)
(Representation operator)

 
repr(x)
Overrides: object.__repr__
(inherited documentation)

checkLinkTargets(self, models, hash)

 
Returns a set of tuples ("<self>(<name>)", <target model>) if the parameter <name> is linked to model <target model> but <target model> is not in the list of models. If a parameter is linked to another parameter set which is not in the hash list the parameter set is checked for its models. hash gives the call history.

declareParameters(self, parameters)

 
Declares a set of parameters. parameters can be a list, a dictionary or a ParameterSet.