pypet/storageservice.py
def _srvc_set_config(self, trajectory):
        """Sets a config value to the Trajectory or changes it if the trajectory was loaded
        a the settings no longer match"""
        def _set_config(name, value, comment):
            if not trajectory.f_contains('config.'+name, shortcuts=False):
                trajectory.f_add_config(Parameter, name, value, comment=comment)

        for attr_name in HDF5StorageService.NAME_TABLE_MAPPING:
            table_name = HDF5StorageService.NAME_TABLE_MAPPING[attr_name]
            value = getattr(self, attr_name)
            _set_config('hdf5.overview.' + table_name,
                         value,
                         comment='Whether or not to have an overview '
                                 'table with that name')

        _set_config('hdf5.purge_duplicate_comments',
                    self._purge_duplicate_comments,
                    comment='Whether comments of results and'
                            ' derived parameters should only'
                            ' be stored for the very first instance.'
                            ' Works only if the summary tables are'
                            ' active.')

        _set_config('hdf5.results_per_run', self._results_per_run,
                    comment='Expected number of results per run,'
                            ' a good guess can increase storage performance')

        _set_config('hdf5.derived_parameters_per_run',
                    self._derived_parameters_per_run,
                    comment='Expected number of derived parameters per run,'
                            ' a good guess can increase storage performance')

        _set_config('hdf5.complevel', self._complevel,
                    comment='Compression Level (0 no compression '
                            'to 9 highest compression)')

        _set_config('hdf5.complib', self._complib,
                    comment='Compression Algorithm')

        _set_config('hdf5.encoding', self._encoding,
                    comment='Encoding for unicode characters')

        _set_config('hdf5.fletcher32', self._fletcher32,
                    comment='Whether to use fletcher 32 checksum')

        _set_config('hdf5.shuffle', self._shuffle,
                    comment='Whether to use shuffle filtering.')

        _set_config('hdf5.pandas_format', self._pandas_format,
                    comment='''How to store pandas data frames, either'''
                            ''' 'fixed' ('f') or 'table' ('t').''')

        if trajectory.f_contains('config.hdf5', shortcuts=False):
            if trajectory.config.hdf5.v_comment == '':
                # If this has not happened yet, add a description of the hdf5 config group
                trajectory.config.hdf5.v_comment = 'Settings for the standard HDF5 storage service'

        trajectory.v_storage_service = self
def _srvc_set_config(self, trajectory):
        """Sets a config value to the Trajectory or changes it if the trajectory was loaded
        a the settings no longer match"""
        def _set_config(name, value, comment):
            if not trajectory.f_contains('config.'+name, shortcuts=False):
                trajectory.f_add_config(Parameter, name, value, comment=comment)

        for attr_name in HDF5StorageService.NAME_TABLE_MAPPING:
            table_name = HDF5StorageService.NAME_TABLE_MAPPING[attr_name]
            value = getattr(self, attr_name)
            _set_config('hdf5.overview.' + table_name,
                         value,
                         comment='Whether or not to have an overview '
                                 'table with that name')

        _set_config('hdf5.purge_duplicate_comments',
                    self._purge_duplicate_comments,
                    comment='Whether comments of results and'
                            ' derived parameters should only'
                            ' be stored for the very first instance.'
                            ' Works only if the summary tables are'
                            ' active.')

        _set_config('hdf5.results_per_run', self._results_per_run,
                    comment='Expected number of results per run,'
                            ' a good guess can increase storage performance')

        _set_config('hdf5.derived_parameters_per_run',
                    self._derived_parameters_per_run,
                    comment='Expected number of derived parameters per run,'
                            ' a good guess can increase storage performance')

        _set_config('hdf5.complevel', self._complevel,
                    comment='Compression Level (0 no compression '
                            'to 9 highest compression)')

        _set_config('hdf5.complib', self._complib,
                    comment='Compression Algorithm')

        _set_config('hdf5.encoding', self._encoding,
                    comment='Encoding for unicode characters')

        _set_config('hdf5.fletcher32', self._fletcher32,
                    comment='Whether to use fletcher 32 checksum')

        _set_config('hdf5.shuffle', self._shuffle,
                    comment='Whether to use shuffle filtering.')

        _set_config('hdf5.pandas_format', self._pandas_format,
                    comment='''How to store pandas data frames, either'''
                            ''' 'fixed' ('f') or 'table' ('t').''')

        if trajectory.f_contains('config.hdf5', shortcuts=False):
            if trajectory.config.hdf5.v_comment == '':
                # If this has not happened yet, add a description of the hdf5 config group
                trajectory.config.hdf5.v_comment = 'Settings for the standard HDF5 storage service'

        trajectory.v_storage_service = self
Sets a config value to the Trajectory or changes it if the trajectory was loaded
        a the settings no longer match