Source code for tvb.core.entities.file.simulator.burst_configuration_h5

# -*- coding: utf-8 -*-
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need to download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also
# (c) 2012-2024, Baycrest Centre for Geriatric Care ("Baycrest") and others
# This program is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.  See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this
# program.  If not, see <>.
# When using The Virtual Brain for scientific publications, please cite it as explained here:

import uuid
from tvb.basic.neotraits.api import Attr
from tvb.core.neotraits.h5 import H5File, Scalar, Reference
from tvb.core.utils import string2date, date2string
from import MissingDataSetException

[docs] class BurstConfigurationH5(H5File): def __init__(self, path): super(BurstConfigurationH5, self).__init__(path) = Scalar(Attr(str), self, name='name') self.status = Scalar(Attr(str), self, name='status') self.error_message = Scalar(Attr(str, required=False), self, name='error_message') self.start_time = Scalar(Attr(str), self, name='start_time') self.finish_time = Scalar(Attr(str, required=False), self, name='finish_time') self.simulator = Reference(Attr(uuid.UUID), self, name='simulator') self.range1 = Scalar(Attr(str, required=False), self, name='range1') self.range2 = Scalar(Attr(str, required=False), self, name='range2')
[docs] def store(self, burst_config, scalars_only=False, store_references=True): # type (BurstConfiguration, bool, bool) -> None or 'None')
[docs] def load_into(self, burst_config): # type (BurstConfiguration) -> None burst_config.gid = self.gid.load().hex = burst_config.status = self.status.load() burst_config.error_message = self.error_message.load() burst_config.start_time = string2date(self.start_time.load()) finish_time = self.finish_time.load() if finish_time and finish_time != 'None': burst_config.finish_time = string2date(finish_time) burst_config.simulator_gid = self.simulator.load().hex try: burst_config.range1 = self.range1.load() except MissingDataSetException: burst_config.range1 = None try: burst_config.range2 = self.range2.load() except MissingDataSetException: burst_config.range2 = None