coupling
classes.coupling
TVB-O wrapper for Coupling functions
- [Coupling](![wiki]/Coupling/index.html)
Classes
| Name | Description |
|---|---|
| Coupling | Runtime Coupling that is also a direct instance of tvbo_datamodel.Coupling. |
Coupling
classes.coupling.Coupling(**kwargs)Runtime Coupling that is also a direct instance of tvbo_datamodel.Coupling.
If iri is set (e.g. tvbo:SigmoidalJansenRit), missing fields are automatically populated from the ontology/database. Use Coupling.from_ontology(name) for explicit ontology lookup.
Methods
| Name | Description |
|---|---|
| from_datamodel | Create a Coupling instance from an existing tvbo_datamodel.Coupling instance. |
| from_db | Load a Coupling by name from the tvbo database. |
| from_file | Load a Coupling from a YAML file. |
| from_ontology | Create a Coupling instance from an ontology Coupling class or name. |
| list_db | List available coupling functions in the tvbo database. |
| populate_from_type | Fill missing pre/post expressions and parameters from a type reference. |
| symbolic | Full symbolic coupling equation with proper indexed state variables. |
from_datamodel
classes.coupling.Coupling.from_datamodel(datamodel_instance)Create a Coupling instance from an existing tvbo_datamodel.Coupling instance.
from_db
classes.coupling.Coupling.from_db(name)Load a Coupling by name from the tvbo database.
from_file
classes.coupling.Coupling.from_file(filepath)Load a Coupling from a YAML file.
from_ontology
classes.coupling.Coupling.from_ontology(ontoclass)Create a Coupling instance from an ontology Coupling class or name.
Accepts an owlready2 class, a plain name ("SigmoidalJansenRit"), or a CURIE ("tvbo:SigmoidalJansenRit"). Tries the database YAML first, then falls back to ontology lookup.
list_db
classes.coupling.Coupling.list_db()List available coupling functions in the tvbo database.
populate_from_type
classes.coupling.Coupling.populate_from_type(type_ref)Fill missing pre/post expressions and parameters from a type reference.
This is used when network.coupling entries specify a type field to reference a known coupling function (e.g. KuramotoCoupling or tvbo:KuramotoCoupling).
Parameters
type_ref : str Coupling function name or CURIE (e.g. "KuramotoCoupling" or "tvbo:KuramotoCoupling").
symbolic
classes.coupling.Coupling.symbolic(delays=False)Full symbolic coupling equation with proper indexed state variables.
Resolves all expression styles (theta_j/theta_i, x_j/x_i, incoming_states/local_states) into proper IndexedBase notation and wraps the pre-expression in a weighted summation over connected nodes.
Parameters
delays : bool If True, incoming states carry an explicit time-delay index: y1[j, t - tau[i, j]] instead of plain y1[j].
Returns
sympy.Expr E.g. Sum(w[i, j]*sin(theta[j] - theta[i]), (j, 0, N - 1))/N
Functions
| Name | Description |
|---|---|
| coupling_class2metadata | Populate coupling metadata from an ontology class. |
coupling_class2metadata
classes.coupling.coupling_class2metadata(ontoclass, metadata, overwrite=False)Populate coupling metadata from an ontology class.
If overwrite is False (default), only fill missing fields. If overwrite is True, always set name and pre/post expressions. Parameters are added if missing; existing parameter value/description are only filled if missing regardless of overwrite.