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

Component

General functions to communicate with c++ objects.

ParSig

Basic functions used for Parameter and Signal classes.

Parameter

General functions to retreive signals from the c++ object.

Signal

General functions to retreive signals from the c++ object.

General

Component object with no locations.

AutoComponent

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
build()[source]
add_object(o)[source]
__repr__()[source]

Object representation in string format.

__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: str, val: any) any[source]

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__()[source]

Iterate over object, used for dict(self).

add(name)[source]
class circadapt.components.ParSig(model, par, locs)[source]

Basic functions used for Parameter and Signal classes.

build()[source]
__repr__()[source]

Object representation in string format.

__add__(val)[source]

Handle the + operator.

__radd__(val)[source]

Handle the + operator as right hand element.

__sub__(val)[source]

Handle the - operator.

__rsub__(val)[source]

Handle the - operator as right hand element.

__mul__(val)[source]

Handle the * operator.

__rmul__(val)[source]

Handle the * operator as right hand element.

__truediv__(val)[source]

Handle the / operator.

__rtruediv__(val)[source]

Handle the / operator as right hand element.

__floordiv__(val)[source]

Handle the // operator.

__rfloordiv__(val)[source]

Handle the // operator.

__mod__(val)[source]

Handle the % operator.

__rmod__(val)[source]

Handle the % operator.

__pow__(val)[source]

Handle the ** operator.

__rpow__(val)[source]

Handle the ** operator as right hand element.

__neg__()[source]

Handle -self.

__lt__(val)[source]

Handle the < operator.

__le__(val)[source]

Handle the <= operator.

__gt__(val)[source]

Handle the > operator.

__ge__(val)[source]

Handle the >= operator.

__eq__(val)[source]

Handle the == operator.

__ne__(val)[source]

Handle the != operator.

__getitem__(arg: any) any[source]

Get data.

This function is called when self[arg].

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.

__len__()[source]

Handle len(self).

__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.

__getitem__(*arg)[source]

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)[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

__len__()[source]

Handle len(self).

__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
__repr__()[source]

Object representation in string format.

__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.

__iter__()[source]

Iterate over object, used for dict(self).

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
add_object(*arg, **kwarg)[source]
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)