simulariumio/md/md_converter.py
def _read_universe_dimensions(
        input_data: MdData,
    ) -> AgentData:
        """
        Use a MD Universe to get the number of timesteps
        and maximum agents per timestep
        """
        result = DimensionData(
            total_steps=0,
            max_agents=0,
        )
        for ts in input_data.md_universe.trajectory[:: input_data.nth_timestep_to_read]:
            result.total_steps += 1
            n_agents = input_data.md_universe.atoms.positions.shape[0]
            if n_agents > result.max_agents:
                result.max_agents = n_agents
        return result

        Use a MD Universe to get the number of timesteps
        and maximum agents per timestep
        
Use a MD Universe to get the number of timesteps
and maximum agents per timestep
Use a MD Universe to get the number of timesteps and maximum agents per timestep
def _read_universe_dimensions(
        input_data: MdData,
    ) -> AgentData:
        result = DimensionData(
            total_steps=0,
            max_agents=0,
        )
        for ts in input_data.md_universe.trajectory[:: input_data.nth_timestep_to_read]:
            result.total_steps += 1
            n_agents = input_data.md_universe.atoms.positions.shape[0]
            if n_agents > result.max_agents:
                result.max_agents = n_agents
        return result
def _read_universe_dimensions ( input_data : MdData , ) -> AgentData : result = DimensionData ( total_steps = 0 , max_agents = 0 , ) for ts in input_data . md_universe . trajectory [ : : input_data . nth_timestep_to_read ] : result . total_steps += 1 n_agents = input_data . md_universe . atoms . positions . shape [ 0 ] if n_agents > result . max_agents : result . max_agents = n_agents return result
Use a MD Universe to get the number of timesteps
and maximum agents per timestep
Use a MD Universe to get the number of timesteps and maximum agents per timestep
"""
        Use a MD Universe to get the number of timesteps
        and maximum agents per timestep
        """
input_data
MdData