Package VisionEgg :: Class ClassWithParameters
[frames | no frames]

Class ClassWithParameters

object --+
         |
        ClassWithParameters

Known Subclasses:
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
  __init__(self, **kw)
Create self.parameters and set values.
  get_specified_type(self, parameter_name)
  is_constant_parameter(self, parameter_name)
  set(self, **kw)
Set a parameter with type-checked value This is the slow but safe way to set parameters.
  verify_parameters(self)
Perform type check on all parameters...
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...
    Inherited from type
  __new__(T, S, ...)
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)
(Constructor)

Create self.parameters and set values.
Overrides:
__builtin__.object.__init__

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__

Type:
tuple
Value:
('parameters', 'constant_parameters')                                  

constant_parameters

Type:
member_descriptor
Value:
<member 'constant_parameters' of 'ClassWithParameters' objects>        

constant_parameters_and_defaults

Type:
ParameterDefinition
Value:
{}                                                                     

parameters

Type:
member_descriptor
Value:
<member 'parameters' of 'ClassWithParameters' objects>                 

parameters_and_defaults

Type:
ParameterDefinition
Value:
{}                                                                     

Generated by Epydoc 2.0 on Fri Sep 19 18:29:38 2003 http://epydoc.sf.net