pypet/storageservice.py
def _prm_add_meta_info(self, instance, group, overwrite=False):
        """Adds information to overview tables and meta information to
        the `instance`s hdf5 `group`.

        :param instance: Instance to store meta info about
        :param group: HDF5 group of instance
        :param overwrite: If data should be explicitly overwritten

        """

        if overwrite:
            flags = ()
        else:
            flags = (HDF5StorageService.ADD_ROW,)

        definitely_store_comment = True
        try:
            # Check if we need to store the comment. Maybe update the overview tables
            # accordingly if the current run index is lower than the one in the table.
            definitely_store_comment = self._prm_meta_add_summary(instance)

            try:
                # Update the summary overview table
                table_name = instance.v_branch + '_overview'

                table = getattr(self._overview_group, table_name)
                if len(table) < pypetconstants.HDF5_MAX_OVERVIEW_TABLE_LENGTH:

                    self._all_store_param_or_result_table_entry(instance, table,
                                                                flags=flags)
            except pt.NoSuchNodeError:
                pass
        except Exception as exc:
            self._logger.error('Could not store information table due to `%s`.' % repr(exc))

        if ((not self._purge_duplicate_comments or definitely_store_comment) and
                    instance.v_comment != ''):
            # Only add the comment if necessary
            setattr(group._v_attrs, HDF5StorageService.COMMENT, instance.v_comment)

        # Add class name and whether node is a leaf to the HDF5 attributes
        setattr(group._v_attrs, HDF5StorageService.CLASS_NAME, instance.f_get_class_name())
        setattr(group._v_attrs, HDF5StorageService.LEAF, True)

        if instance.v_is_parameter and instance.v_explored:
            # If the stored parameter was an explored one we need to mark this in the
            # explored overview table
            try:
                tablename = 'explored_parameters_overview'
                table = getattr(self._overview_group, tablename)

                if len(table) < pypetconstants.HDF5_MAX_OVERVIEW_TABLE_LENGTH:
                    self._all_store_param_or_result_table_entry(instance, table,
                                                                flags=flags)
            except pt.NoSuchNodeError:
                pass
            except Exception as exc:
                self._logger.error('Could not store information '
                                   'table due to `%s`.' % repr(exc))
def _prm_add_meta_info(self, instance, group, overwrite=False):
        if overwrite:
            flags = ()
        else:
            flags = (HDF5StorageService.ADD_ROW,)

        definitely_store_comment = True
        try:
            # Check if we need to store the comment. Maybe update the overview tables
            # accordingly if the current run index is lower than the one in the table.
            definitely_store_comment = self._prm_meta_add_summary(instance)

            try:
                # Update the summary overview table
                table_name = instance.v_branch + '_overview'

                table = getattr(self._overview_group, table_name)
                if len(table) < pypetconstants.HDF5_MAX_OVERVIEW_TABLE_LENGTH:

                    self._all_store_param_or_result_table_entry(instance, table,
                                                                flags=flags)
            except pt.NoSuchNodeError:
                pass
        except Exception as exc:
            self._logger.error('Could not store information table due to `%s`.' % repr(exc))

        if ((not self._purge_duplicate_comments or definitely_store_comment) and
                    instance.v_comment != ''):
            # Only add the comment if necessary
            setattr(group._v_attrs, HDF5StorageService.COMMENT, instance.v_comment)

        # Add class name and whether node is a leaf to the HDF5 attributes
        setattr(group._v_attrs, HDF5StorageService.CLASS_NAME, instance.f_get_class_name())
        setattr(group._v_attrs, HDF5StorageService.LEAF, True)

        if instance.v_is_parameter and instance.v_explored:
            # If the stored parameter was an explored one we need to mark this in the
            # explored overview table
            try:
                tablename = 'explored_parameters_overview'
                table = getattr(self._overview_group, tablename)

                if len(table) < pypetconstants.HDF5_MAX_OVERVIEW_TABLE_LENGTH:
                    self._all_store_param_or_result_table_entry(instance, table,
                                                                flags=flags)
            except pt.NoSuchNodeError:
                pass
            except Exception as exc:
                self._logger.error('Could not store information '
                                   'table due to `%s`.' % repr(exc))
def _prm_add_meta_info ( self , instance , group , overwrite = False ) : if overwrite : flags = ( ) else : flags = ( HDF5StorageService . ADD_ROW , ) definitely_store_comment = True try : # Check if we need to store the comment. Maybe update the overview tables # accordingly if the current run index is lower than the one in the table. definitely_store_comment = self . _prm_meta_add_summary ( instance ) try : # Update the summary overview table table_name = instance . v_branch + '_overview' table = getattr ( self . _overview_group , table_name ) if len ( table ) < pypetconstants . HDF5_MAX_OVERVIEW_TABLE_LENGTH : self . _all_store_param_or_result_table_entry ( instance , table , flags = flags ) except pt . NoSuchNodeError : pass except Exception as exc : self . _logger . error ( 'Could not store information table due to `%s`.' % repr ( exc ) ) if ( ( not self . _purge_duplicate_comments or definitely_store_comment ) and instance . v_comment != '' ) : # Only add the comment if necessary setattr ( group . _v_attrs , HDF5StorageService . COMMENT , instance . v_comment ) # Add class name and whether node is a leaf to the HDF5 attributes setattr ( group . _v_attrs , HDF5StorageService . CLASS_NAME , instance . f_get_class_name ( ) ) setattr ( group . _v_attrs , HDF5StorageService . LEAF , True ) if instance . v_is_parameter and instance . v_explored : # If the stored parameter was an explored one we need to mark this in the # explored overview table try : tablename = 'explored_parameters_overview' table = getattr ( self . _overview_group , tablename ) if len ( table ) < pypetconstants . HDF5_MAX_OVERVIEW_TABLE_LENGTH : self . _all_store_param_or_result_table_entry ( instance , table , flags = flags ) except pt . NoSuchNodeError : pass except Exception as exc : self . _logger . error ( 'Could not store information ' 'table due to `%s`.' % repr ( exc ) )
Adds information to overview tables and meta information to
        the `instance`s hdf5 `group`.

        :param instance: Instance to store meta info about
        :param group: HDF5 group of instance
        :param overwrite: If data should be explicitly overwritten
Adds information to overview tables and meta information to the instance s hdf5 group .