pypet/storageservice.py
def _ann_load_annotations(self, item_with_annotations, node):
        """Loads annotations from disk."""

        annotated = self._all_get_from_attrs(node, HDF5StorageService.ANNOTATED)

        if annotated:

            annotations = item_with_annotations.v_annotations

            # You can only load into non-empty annotations, to prevent overwriting data in RAM
            if not annotations.f_is_empty():
                raise TypeError('Loading into non-empty annotations!')

            current_attrs = node._v_attrs

            for attr_name in current_attrs._v_attrnames:

                if attr_name.startswith(HDF5StorageService.ANNOTATION_PREFIX):
                    key = attr_name
                    key = key.replace(HDF5StorageService.ANNOTATION_PREFIX, '')

                    data = getattr(current_attrs, attr_name)
                    setattr(annotations, key, data)
def _ann_load_annotations(self, item_with_annotations, node):
        annotated = self._all_get_from_attrs(node, HDF5StorageService.ANNOTATED)

        if annotated:

            annotations = item_with_annotations.v_annotations

            # You can only load into non-empty annotations, to prevent overwriting data in RAM
            if not annotations.f_is_empty():
                raise TypeError('Loading into non-empty annotations!')

            current_attrs = node._v_attrs

            for attr_name in current_attrs._v_attrnames:

                if attr_name.startswith(HDF5StorageService.ANNOTATION_PREFIX):
                    key = attr_name
                    key = key.replace(HDF5StorageService.ANNOTATION_PREFIX, '')

                    data = getattr(current_attrs, attr_name)
                    setattr(annotations, key, data)
def _ann_load_annotations ( self , item_with_annotations , node ) : annotated = self . _all_get_from_attrs ( node , HDF5StorageService . ANNOTATED ) if annotated : annotations = item_with_annotations . v_annotations # You can only load into non-empty annotations, to prevent overwriting data in RAM if not annotations . f_is_empty ( ) : raise TypeError ( 'Loading into non-empty annotations!' ) current_attrs = node . _v_attrs for attr_name in current_attrs . _v_attrnames : if attr_name . startswith ( HDF5StorageService . ANNOTATION_PREFIX ) : key = attr_name key = key . replace ( HDF5StorageService . ANNOTATION_PREFIX , '' ) data = getattr ( current_attrs , attr_name ) setattr ( annotations , key , data )
Loads annotations from disk.
Loads annotations from disk .