swc.aeon.schema.base#

Base classes for defining experiment configuration and data models.

class swc.aeon.schema.base.BaseSchema(**data)[source]#

Bases: BaseModel

The base class for all experiment configuration and data models.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'arbitrary_types_allowed': True, 'field_title_generator': <function BaseSchema.<lambda>>, 'from_attributes': True, 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

class swc.aeon.schema.base.Dataset(**data)[source]#

Bases: BaseSchema

The base class for creating dataset models.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'arbitrary_types_allowed': True, 'field_title_generator': <function BaseSchema.<lambda>>, 'from_attributes': True, 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

class swc.aeon.schema.base.Experiment(**data)[source]#

Bases: BaseSchema

The base class for creating experiment models.

commit: str#
model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'arbitrary_types_allowed': True, 'field_title_generator': <function BaseSchema.<lambda>>, 'from_attributes': True, 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

repository_url: str#
workflow: str#
class swc.aeon.schema.base.Metadata(type, pattern='Metadata')[source]#

Bases: Reader

Extracts metadata information from all epochs in the dataset.

columns: SequenceNotStr[str]#

Column labels to use for the data.

extension: str#

Extension of data file pathnames.

pattern: str#

Pattern used to find raw files, usually in the format <Device>_<DataStream>.

read(path)[source]#

Returns metadata for the epoch associated with the specified file.

Return type:

DataFrame

swc.aeon.schema.base.data_reader(func)[source]#

Decorator to include a data reader as cached_property in experiment dataset models.

Return type:

cached_property[TypeVar(_ReaderT, bound= Reader)]