| Home | Trees | Index | Help |
|
|---|
| Package VisionEgg :: Class ClassWithParameters |
|
object --+
|
ClassWithParameters
Channel,
ChannelParameters,
Mask2D,
Presentation,
Projection,
Screen,
Stimulus,
Trigger,
Viewport
Base class for any class that uses parameters.
Any class that uses parameters potentially modifiable in realtime
should be a subclass of ClassWithParameters. This class enforces
type checking and sets default values.
Any subclass of ClassWithParameters can define two class (not
instance) attributes, "parameters_and_defaults" and
"constant_parameters_and_defaults". These are dictionaries where
the key is a string containing the name of the parameter and the
the value is a tuple of length 2 containing the default value and
the type. For example, an acceptable dictionary would be
{"parameter1" : (1.0, ve_types.Real)}
See the ParameterTypes module for more information about types.
| Method Summary | |
|---|---|
Create self.parameters and set values. | |
get_specified_type(self,
parameter_name)
| |
is_constant_parameter(self,
parameter_name)
| |
Set a parameter with type-checked value This is the slow but safe way to set parameters. | |
Perform type check on all parameters... | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name... | |
x.__getattribute__('name') <==> x.name... | |
x.__hash__() <==> hash(x)... | |
helper for pickle... | |
helper for pickle... | |
x.__repr__() <==> repr(x)... | |
x.__setattr__('name', value) <==> x.name = value... | |
x.__str__() <==> str(x)... | |
| Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T... | |
| Class Variable Summary | |
|---|---|
tuple |
__slots__ = ('parameters', 'constant_parameters')
|
member_descriptor |
constant_parameters = <member 'constant_parameters' of '...
|
ParameterDefinition |
constant_parameters_and_defaults = {}
|
member_descriptor |
parameters = <member 'parameters' of 'ClassWithParameter...
|
ParameterDefinition |
parameters_and_defaults = {}
|
| Method Details |
|---|
__init__(self,
**kw)
|
set(self, **kw)Set a parameter with type-checked value This is the slow but safe way to set parameters. It is recommended to use this method in all but speed-critical portions of code. |
verify_parameters(self)Perform type check on all parameters |
| Class Variable Details |
|---|
__slots__
|
constant_parameters
|
constant_parameters_and_defaults
|
parameters
|
parameters_and_defaults
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.0 on Fri Sep 19 18:29:38 2003 | http://epydoc.sf.net |