porereax.density ================ .. py:module:: porereax.density .. autoapi-nested-parse:: Module for sampling atomic and bond densities. The module provides: 1. :class:`DensitySampler`: A class to sample atomic densities of specified atom structures. 2. :class:`BondDensitySampler`: A class to sample bond densities of specified bonds. Both samplers support multiple dimensions for density sampling: - "Cartesian1D": Samples the density histogram along a specified Cartesian direction for the whole simulation box. - "Cartesian2D": Samples the density histogram in a specified plane for the whole simulation box. - "Time": Samples the number of atoms (with given bonds) or bonds per frame Classes ------- .. autoapisummary:: porereax.density.DensitySampler porereax.density.BondDensitySampler porereax.density.ReactionSampler Module Contents --------------- .. py:class:: DensitySampler(name_out: str, atoms: list, dimension: str, region, process_id: int, atom_lib: dict, masses: dict, num_frames: int, box: numpy.ndarray, system_properties: dict, num_bins: int, direction: str, conditions: dict = {}) Bases: :py:obj:`porereax.meta_sampler.AtomSampler` Sampler class for atomic densities. .. py:method:: sample(frame_id: int, mol_index: dict, mol_bonds: dict, bond_mask: dict, frame: object, bond_enum: object, positions_transformed: numpy.ndarray) Sample data for the current frame. Must be implemented by subclasses. .. py:method:: join_samplers(num_cores) Join data from multiple samplers after parallel processing. :param num_cores: Number of parallel processes used. :type num_cores: int .. py:class:: BondDensitySampler(name_out: str, bonds: list, dimension: str, region, process_id: int, atom_lib: dict, masses: dict, num_frames: int, box: numpy.ndarray, system_properties: dict, num_bins: int, direction: str, conditions: dict = {}) Bases: :py:obj:`porereax.meta_sampler.BondSampler` Sampler class for bond densities. .. py:method:: sample(frame_id: int, mol_index: dict, mol_bonds: dict, bond_mask: dict, frame: object, bond_enum: object, positions_transformed: numpy.ndarray) Sample data for the current frame. Must be implemented by subclasses. .. py:method:: join_samplers(num_cores: int) -> None Join data from multiple samplers after parallel processing. :param num_cores: Number of parallel processes used. :type num_cores: int .. py:class:: ReactionSampler(name_out: str, reactions: list, dimension: str, region, process_id: int, atom_lib: dict, masses: dict, num_frames: int, box: numpy.ndarray, system_properties: dict, num_bins: int, direction: str, position: str) Bases: :py:obj:`porereax.meta_sampler.AtomSampler` Sampler class for reactions. .. py:method:: sample(frame_id: int, mol_index: dict, mol_bonds: dict, bond_mask: dict, frame: object, bond_enum: object, positions_transformed: numpy.ndarray) Sample data for the current frame. Must be implemented by subclasses. .. py:method:: join_samplers(num_cores: int) -> None Join data from multiple samplers after parallel processing. :param num_cores: Number of parallel processes used. :type num_cores: int