Source code for subcell_pipeline.simulation.readdy.data_structures
"""Data structures for ReaDDy simulations."""fromtypingimportOptionalimportnumpyasnp
[docs]classTopologyData:"""Data class representing a ReaDDy topology of connected particles."""uid:int"""Unique ID of the topology from ReaDDy."""type_name:str"""ReaDDy type name of the topology."""particle_ids:list[int]"""List of unique IDs of each particle in the topology."""
def__str__(self)->str:return("Topology(\n"f" id = {self.uid}\n"f" type_name = {self.type_name}\n"f" particles = {self.particle_ids}\n"")")
[docs]classParticleData:"""Data class representing a ReaDDy particle."""uid:int"""Unique ID of the particle from ReaDDy."""type_name:str"""ReaDDy type name of the particle."""position:np.ndarray"""The x,y,z position of the particle."""neighbor_ids:list[int]"""List of unique IDs of each neighbor particle connected by an edge."""
def__str__(self)->str:return(f"Particle(\n"f" id = {self.uid}\n"f" type_name = {self.type_name}\n"f" position = {self.position}\n"f" neighbors = {self.neighbor_ids}\n"")")
[docs]classFrameData:"""Data class representing one ReaDDy timestep."""time:float"""Current time of the simulation for this frame."""topologies:dict[int,TopologyData]"""Mapping of topology ID to a TopologyData for each topology."""particles:dict[int,ParticleData]"""Mapping of particle ID to a ParticleData for each particle."""edge_ids:list[list[int]]"""List of edges, each is a list of IDs of the two connected particles."""