class pypet.annotations.Annotations[source]

Simple container class for annotations.

Every tree node (leaves and group nodes) can be annotated. In case you use the standard HDF5StorageService, these annotations are stored in the attributes of the hdf5 nodes in the hdf5 file, you might wanna take a look at pytables attributes.

Annotations should be small (short strings or basic python data types) since their storage and retrieval is quite slow!


Returns all annotations lexicographically sorted as a concatenated string.


Removes all annotations from RAM


Returns annotations

If len(args)>1, then returns a list of annotations.

f_get(X) with X integer will return the annotation with name annotation_X.

If the annotation contains only a single entry you can call f_get() without arguments. If you call f_get() and the annotation contains more than one element a ValueError is thrown.


Checks if annotations are empty


Removes key from annotations

f_set(*args, **kwargs)[source]

Sets annotations

Items in args are added as annotation and annotation_X where ‘X’ is the position in args for following arguments.

f_set_single(name, data)[source]

Sets a single annotation.


Returns annotations as dictionary.

Parameters:copy – Whether to return a shallow copy or the real thing (aka _dict).