dcnum.write.chunk_writer ======================== .. py:module:: dcnum.write.chunk_writer Classes ------- .. autoapisummary:: dcnum.write.chunk_writer.ChunkWriter Module Contents --------------- .. py:class:: ChunkWriter(path_out: pathlib.Path | dcnum.common.h5py.File, dq: collections.deque, write_queue_size: multiprocessing.sharedctypes.Synchronized, ds_kwds: dict | None = None, mode: str = 'a', parent_logger: logging.Logger | None = None, *args, **kwargs) Bases: :py:obj:`threading.Thread` Convenience class for writing to data outside the main loop Data are numpy arrays collected from a `dequeue` object :param path_out: Path to the output HDF5 file :param dq: `collections.deque` object from which data are taken using `popleft()`. :type dq: collections.deque :param write_queue_size: Multiprocessing value to which the size of `dq` is written periodically :param ds_kwds: keyword arguments for dataset creation, passed to :class:`.HDF5Writer` :param mode: HDF5 file opening mode, passed to :class:`.HDF5Writer` .. py:attribute:: writer .. py:attribute:: dq .. py:attribute:: may_stop_loop :value: False .. py:attribute:: must_stop_loop :value: False .. py:attribute:: write_queue_size .. py:method:: abort_loop() Force aborting the loop as soon as possible .. py:method:: finished_when_queue_empty() Stop the loop as soon as `self.dq` is empty .. py:method:: run() Method representing the thread's activity. You may override this method in a subclass. The standard run() method invokes the callable object passed to the object's constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.