offspect.cache.attrs

class AnnotationDictionary(*args, **kwargs)[source]

A subclass of dict storing all values internally as string

encoding / decoding is performed with encode() and decode(), and valid values should be limited to int, float and str and the respective Lists of them.

Hint

use the get and set methods to directly access the string representation, the [key] approach automatically decodes / encodes

use update to overwrite without encoding, e.g. if the values are already str

update([E, ]**F) → None. Update D from dict/iterable E and F.[source]

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

class AnnotationFactory(readin, readout, origin='')[source]

A factory to create new annotations

Parameters
  • readin (str) – the format of the data being readin, e.g. tms or pes

  • readout (str) – the format of how the data will be used for display and analysis, e.g. wave, cmep, imep, erp

  • origin (str) – the original source-file from where this data is coming from

append_trace_attr(attrs)[source]

append a TraceAttribute to the current list of TraceAttributes

get(key)[source]

returns a value for a global field

property rio

The readin/out parameter

This parameter defines which keys are valid for the TraceAttributes and defines what the GUI should show

set(key, value)[source]

perform checks for validity and sets a value for a global field

property valid_trace_keys

a list of which keys are required and valid for the TraceAttributes

decode(value)[source]

decode any value from string

encode(value)[source]

encode any value to string for storing as TraceAttribute value

get_valid_trace_keys(readin, readout=None)[source]