Todo
Improve autoapi module
circadapt.components
Components for easy input/output of the CircAdapt model.
The component is a general class. It holds parameters that will be called using the Parameter object and signals that are called using the Signals object.
Package Contents
Classes
General functions to communicate with c++ objects. |
|
Basic functions used for Parameter and Signal classes. |
|
General functions to retreive signals from the c++ object. |
|
General functions to retreive signals from the c++ object. |
|
Component object with no locations. |
|
Any component that automatically detects the parameters from the c++ class. |
Submodules
Objects
- class circadapt.components.Component(component_type, model, objects=None)[source]
General functions to communicate with c++ objects.
Parameters
- model: ctypes object
C++ model
- locs: string
Locations of objects in the c++ model that can be altered along this component
- parameters = []
- signals = []
- parameter_on_set
- __getitem__(arg: any) any [source]
Get data.
This function is called when self[arg].
Parameters
- arg: slice or string
If slice, return a components object with locs obtained from slice. If str, return the parameter or signal for all locs
- class circadapt.components.ParSig(model, par, locs)[source]
Basic functions used for Parameter and Signal classes.
- class circadapt.components.Parameter(model, par, locs, parameter_on_set=None)[source]
Bases:
ParSig
General functions to retreive signals from the c++ object.
Parameters
- model: ctypes object
C++ model
- par: str
Parameter name that will be obtained from each loc.
- locs: string
Locations of objects in the c++ model that can be altered along this component.
- __setitem__(arg, value)[source]
Set data.
Set data of the parameter for locs given in arg. Only parameter names can be used.
Parameters
- arg: slice
Locations to be changed.
- val: float/int/bool
Value will automatically be translated to type of the parameter.
- build()
- __repr__()
Object representation in string format.
- __add__(val)
Handle the + operator.
- __radd__(val)
Handle the + operator as right hand element.
- __sub__(val)
Handle the - operator.
- __rsub__(val)
Handle the - operator as right hand element.
- __mul__(val)
Handle the * operator.
- __rmul__(val)
Handle the * operator as right hand element.
- __truediv__(val)
Handle the / operator.
- __rtruediv__(val)
Handle the / operator as right hand element.
- __floordiv__(val)
Handle the // operator.
- __rfloordiv__(val)
Handle the // operator.
- __mod__(val)
Handle the % operator.
- __rmod__(val)
Handle the % operator.
- __pow__(val)
Handle the ** operator.
- __rpow__(val)
Handle the ** operator as right hand element.
- __neg__()
Handle -self.
- __lt__(val)
Handle the < operator.
- __le__(val)
Handle the <= operator.
- __gt__(val)
Handle the > operator.
- __ge__(val)
Handle the >= operator.
- __eq__(val)
Handle the == operator.
- __ne__(val)
Handle the != operator.
- class circadapt.components.Signal(model, par, locs)[source]
Bases:
ParSig
General functions to retreive signals from the c++ object.
Parameters
- model: ctypes object
C++ model
- par: str
Parameter name that will be obtained from each loc.
- locs: string
Locations of objects in the c++ model that can be altered along this component
- __setitem__(arg: any, value) any [source]
Set data.
Function is called when use self[arg].
Raises
Always raise error, signals can not be changed.
- __getitem__(arg: any) any [source]
Get data.
This function is called when self[arg].
Parameters
- arg: slice or string
If slice, return a components object with locs obtained from slice. If str, return the parameter or signal for all locs
- build()
- __repr__()
Object representation in string format.
- __add__(val)
Handle the + operator.
- __radd__(val)
Handle the + operator as right hand element.
- __sub__(val)
Handle the - operator.
- __rsub__(val)
Handle the - operator as right hand element.
- __mul__(val)
Handle the * operator.
- __rmul__(val)
Handle the * operator as right hand element.
- __truediv__(val)
Handle the / operator.
- __rtruediv__(val)
Handle the / operator as right hand element.
- __floordiv__(val)
Handle the // operator.
- __rfloordiv__(val)
Handle the // operator.
- __mod__(val)
Handle the % operator.
- __rmod__(val)
Handle the % operator.
- __pow__(val)
Handle the ** operator.
- __rpow__(val)
Handle the ** operator as right hand element.
- __neg__()
Handle -self.
- __lt__(val)
Handle the < operator.
- __le__(val)
Handle the <= operator.
- __gt__(val)
Handle the > operator.
- __ge__(val)
Handle the >= operator.
- __eq__(val)
Handle the == operator.
- __ne__(val)
Handle the != operator.
- class circadapt.components.General(model)[source]
Bases:
Component
Component object with no locations.
- parameters
- signals
- parameter_on_set
- __getitem__(arg: any) any [source]
Get data.
This function is called when self[arg].
Parameters
- arg: slice or string
If slice, return a components object with locs obtained from slice. If str, return the parameter or signal for all locs
- __setitem__(arg, value)[source]
Set data.
Set data of the parameter for locs given in arg. Only parameter names can be used.
Parameters
- arg: slice
Locations to be changed.
- val: float/int/bool
Value will automatically be translated to type of the parameter.
- build()
- add_object(o)
- add(name)
- class circadapt.components.AutoComponent(component_type, model, objects=None)[source]
Bases:
Component
Any component that automatically detects the parameters from the c++ class.
This type of component is especially for plugins. No special functions are given to this type of component.
- parameters = []
- signals = []
- parameter_on_set
- build()
- __repr__()
Object representation in string format.
- __getitem__(arg: any) any
Get data.
This function is called when self[arg].
Parameters
- arg: slice or string
If slice, return a components object with locs obtained from slice. If str, return the parameter or signal for all locs
- __setitem__(arg: str, val: any) any
Set data.
Set data of the parameter given in arg. Only parameter names can be used.
Parameters
- arg: str
Parameter name
- val: float/int/bool
Value will automatically be translated to type to
- __iter__()
Iterate over object, used for dict(self).
- add(name)