| Trees | Indices | Help |
|
|---|
|
|
|
|||
|
Param Base class for all Param classes. |
|||
|
ParamMeta This metaclass modifies the creation of CompoundParam instances in the following ways: |
|||
|
CompoundParam A collection of Params that itself is a Param. |
|||
|
ParamModel Inherit all functionality of CompoundParam with name that designates this class as a model. |
|||
| FloatParam | |||
| IntParam | |||
| StringParam | |||
| BoolParam | |||
| DictParam | |||
| ListParam | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
__package__ =
|
|||
|
|||
Takes any representation of a param and returns a dictionary representation of param values keyed by param name. Compound params are represented as nested dictionaries. The representation can be a dictionary or an object with params.
|
Updates the values of all params in an object using the values specified in a dictionary of values keyed by param name.
|
Enables access to a param value on an object via an abstract param
reference. The abstract reference is the one which begins with a class
rather than an instance. Example, for an instance a1 of class Atom:
val = get_obj_param_value(a1, Atom.coord.x)
val should have the value of a1.coord.x, e.g. a C{float}. It can also return
a non-fundamental type, for example
val = get_obj_param_value(a1, Atom.coord)
In this case, val is a1.coord, an instance of a Coord class that has x and y
attributes.
@param obj: the instance from which to get the param value
@param param: an abstract Param reference that belongs to obj
@type param: L{Param}
|
Set the value of a param on an instance by specifying the instance, an
abstract param reference, and the value. Example, for an instance a1 of class
Atom:
set_obj_param_value(a1, Atom.coord.x, 5)
This should set the value of a1.coord.x to 5. This function can also be used
to set the value of more complicated parameters, e.g.
c = Coord()
c.x = 5
c.y = 1
set_obj_param_value(a1, Atom.coord, c)
This should set the value of a1.coord.x to 5 and the value of a1.coord.y to
1. If the Coord class had any other attributes, it would overwrite the
values of those as well in a1.coord.
@param obj: the instance from which to get the param value
@param param: an abstract Param reference
@type param: L{Param}
@param value: the value to set
|
Given an object and an abstract param chain, find the concrete counterpart to each abstract param in the chain. Example, given object foo of class Foo, _traverse_owner_chain(foo, Foo.bar.coord.x) will return the value of foo.bar.coord.x.
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Tue May 2 06:32:57 2017 | http://epydoc.sourceforge.net |