def add_data(self, S, F=None, minibatchsize=None):
        assert isinstance(S, np.ndarray) and S.ndim == 2 and S.shape[1] == self.K \
               and np.amin(S) >= 0 and S.dtype == np.int, \
               "Data must be a TxK array of event counts"

        T = S.shape[0]

        # Filter the data into a TxKxB array
        if F is not None:
            assert isinstance(F, np.ndarray) and F.shape == (T, self.K, self.B), \
                "F must be a filtered event count matrix"
        else:
            F = self.basis.convolve_with_basis(S)

        # If minibatchsize is not None, add minibatches of data
        if minibatchsize is not None:
            for offset in np.arange(T, step=minibatchsize):
                end = min(offset+minibatchsize, T)
                T_mb = end - offset
                S_mb = S[offset:end,:]
                F_mb = F[offset:end,:]

                # Instantiate parent object for this minibatch
                parents = self._parent_class(self, T_mb, S_mb, F_mb)

                # Add minibatch to the data list
                self.data_list.append(parents)

        else:
            # Instantiate corresponding parent object
            parents = self._parent_class(self, T, S, F)

            # Add to the data list
            self.data_list.append(parents)
Add a data set to the list of observations.
dataset/ETHPy150Open slinderman/pyhawkes/pyhawkes/models.py/_DiscreteTimeNetworkHawkesModelBase.add_data