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)
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
- objects
- build()
- add_object(o)
- __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)
- class circadapt.components.ParSig(model, par, locs)
Basic functions used for Parameter and Signal classes.
- objects
- 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.
- __getitem__(arg: any) any
Get data.
This function is called when self[arg].
- class circadapt.components.Parameter(model, par, locs, parameter_on_set=None)
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.
- parameter_on_set
- shape
- __len__()
Handle len(self).
- __setitem__(arg, value)
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.
- __getitem__(*arg)
Get data.
This function is called when self[arg].
- 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)
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
- val0
- ndim
- __len__()
Handle len(self).
- __setitem__(arg: any, value) any
Set data.
Function is called when use self[arg].
Raises
Always raise error, signals can not be changed.
- __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
- 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)
Bases:
Component
Component object with no locations.
- parameters
- signals
- parameter_on_set
- __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, value)
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.
- __iter__()
Iterate over object, used for dict(self).
- build()
- add_object(o)
- add(name)
- class circadapt.components.AutoComponent(component_type, model, objects=None)
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
- add_object(*arg, **kwarg)
- 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)