Beispiel #1
0
 def read_observable_reactions(self, data_set_name="reactions"):
     """
     Reads back the output of the "reactions" observable
     :param data_set_name: The data set name as given in the simulation setup
     :return: a tuple which contains an array corresponding to the time as first entry and a list of lists containing
              reaction record objects as second entry
     """
     time = None
     group_path = "readdy/observables/" + data_set_name
     with _h5py.File(self._filename, "r") as f:
         if not group_path in f:
             raise ValueError("The reactions observable was not recorded in the file or recorded under a "
                              "different name!")
         time = f[group_path]["time"][:]
     return time, _read_reaction_observable(self._filename, data_set_name)
Beispiel #2
0
 def read_observable_reactions(self, data_set_name="reactions"):
     """
     Reads back the output of the "reactions" observable
     :param data_set_name: The data set name as given in the simulation setup
     :return: a tuple which contains an array corresponding to the time as first entry and a list of lists containing
              reaction record objects as second entry
     """
     time = None
     group_path = "readdy/observables/" + data_set_name
     with _h5py.File(self._filename, "r") as f:
         if not group_path in f:
             raise ValueError(
                 "The reactions observable was not recorded in the file or recorded under a "
                 "different name!")
         time = f[group_path]["time"][:]
     return time, _read_reaction_observable(self._filename, data_set_name)