mvpa2.base.param.KernelParameter

Inheritance diagram of KernelParameter
class mvpa2.base.param.KernelParameter(default, constraints=None, ro=False, index=None, value=None, name=None, doc=None, **kwargs)

Just that it is different beast

Attributes

default
equal_default Returns True if current value is equal to default one
is_default Returns True if current value is bound to default one
is_set
name
value

Methods

reset() Simply reset the flag
reset_value() Reset value to the default

Specify a Parameter with a default value and arbitrary number of additional attributes.

Parameters:

constraints : callable

A functor that takes any input value, performs checks or type conversions and finally returns a value that is appropriate for a parameter or raises an exception.

name : str

Name of the parameter under which it should be available in its respective collection.

doc : str

Documentation about the purpose of this parameter.

index : int or None

Index of parameter among the others. Determines order of listing in help. If None, order of instantiation determines the index.

ro : bool

Either value which will be assigned in the constructor is read-only and cannot be changed

value

Actual value of the parameter to be assigned

Examples

-ensure the parameter to be of type float (None not allowed as value): constraints = EnsureFloat() >>> from mvpa2.base.param import Parameter >>> from mvpa2.base.constraints import (EnsureFloat, EnsureRange, ... AltConstraints, Constraints) >>> C = Parameter(23.0, constraints=EnsureFloat())

-ensure the parameter to be of type float or to be None: >>> C = Parameter(23.0, constraints=AltConstraints(EnsureFloat(), None))

-ensure the parameter to be None or to be of type float and lie in the inclusive range (7.0,44.0): >>> C = Parameter(23.0, AltConstraints(Constraints(EnsureFloat(), ... EnsureRange(min=7.0,max=44.0)), ... None))

Attributes

default
equal_default Returns True if current value is equal to default one
is_default Returns True if current value is bound to default one
is_set
name
value

Methods

reset() Simply reset the flag
reset_value() Reset value to the default