observation

classes.observation

Classes

Name Description
Observation Wrapper around the LinkML Observation datamodel with convenience

Observation

classes.observation.Observation(
    name=None,
    acronym=None,
    label=None,
    description=None,
    equation=None,
    parameters=empty_dict(),
    environment=None,
    time_scale='ms',
    source=None,
    period=None,
    downsample_period=None,
    voi=None,
    imaging_modality=None,
    warmup_source=None,
    data_source=None,
    skip_t=None,
    tail_samples=None,
    aggregation=None,
    window_size=None,
    pipeline=empty_list(),
    class_reference=None,
)

Wrapper around the LinkML Observation datamodel with convenience factory methods for loading from file, database, or TVB monitors.

Methods

Name Description
execute Convert this observation to a backend monitor object.
from_db Load an Observation by name from the tvbo database.
from_file Load an Observation from a YAML file.
list_db List available observation models in the tvbo database.
render_code Generate backend code that creates this monitor.
execute
classes.observation.Observation.execute(format='tvb')

Convert this observation to a backend monitor object.

Parameters

format : str Target backend. Currently "tvb" is supported.

Returns

tvb.simulator.monitors.Monitor Configured TVB monitor instance.

from_db
classes.observation.Observation.from_db(name)

Load an Observation by name from the tvbo database.

from_file
classes.observation.Observation.from_file(path)

Load an Observation from a YAML file.

list_db
classes.observation.Observation.list_db()

List available observation models in the tvbo database.

render_code
classes.observation.Observation.render_code(format='tvb')

Generate backend code that creates this monitor.

Parameters

format : str Target backend. Currently "tvb" is supported.

Returns

str Executable Python code string.

Functions

Name Description
expand_to_4d Expand dimensions of the input array to ensure it has 4 dimensions.
functioninstance2metadata Normalize a function/ontology instance into datamodel kwargs.

expand_to_4d

classes.observation.expand_to_4d(array)

Expand dimensions of the input array to ensure it has 4 dimensions.

functioninstance2metadata

classes.observation.functioninstance2metadata(function_instance, **kwargs)

Normalize a function/ontology instance into datamodel kwargs.

  • For Python callables: infer arguments/parameters, capture source code, record callable path (module + qualname), and infer software requirements.
  • For ontology instances: map fields from the ontology to datamodel shape.