dcnum.write.event_stash ======================= .. py:module:: dcnum.write.event_stash Classes ------- .. autoapisummary:: dcnum.write.event_stash.EventStash Module Contents --------------- .. py:class:: EventStash(index_offset: int, feat_nevents: list[int]) Sort events into predefined arrays for bulk access :param index_offset: This is the index offset at which we are working on. Normally, `feat_nevents` is just a slice of a larger array and `index_offset` defines at which position it is taken. :param feat_nevents: List that defines how many events there are for each input frame. If summed up, this defines `self.size`. .. py:attribute:: events Dictionary containing the event arrays .. py:attribute:: feat_nevents List containing the number of events per input frame .. py:attribute:: nev_idx Cumulative sum of `feat_nevents` for determining sorting offsets .. py:attribute:: size Number of events in this stash .. py:attribute:: num_frames Number of frames in this stash .. py:attribute:: index_offset Global offset compared to the original data instance. .. py:attribute:: indices_for_data Array containing the indices in the original data instance. These indices correspond to the events in `events`. .. py:attribute:: _tracker Private array that tracks the progress. .. py:method:: is_complete() Determine whether the event stash is complete (all events added) .. py:method:: add_events(index, events) Add events to this stash :param index: Global index (from input dataset) :type index: int :param events: Event dictionary :type events: dict .. py:method:: require_feature(feat, sample_data) Create a new empty feature array in `self.events` and return it :param feat: Feature name :param sample_data: Sample data for one event of the feature (used to determine shape and dtype of the feature array)