simulariumio/readdy/readdy_converter.py
def _get_agent_data(
        input_data: ReaddyData,
    ) -> AgentData:
        """
        Pack raw ReaDDy trajectory data into AgentData,
        ignoring particles with type names in ignore_types
        """
        (
            traj,
            n_agents,
            positions,
            type_ids,
            ids,
        ) = ReaddyConverter._get_raw_trajectory_data(input_data)
        data_dimensions = DimensionData(
            total_steps=n_agents.shape[0],
            max_agents=int(np.amax(n_agents)),
        )
        result = AgentData.from_dimensions(data_dimensions)
        result.times = input_data.timestep * np.arange(data_dimensions.total_steps)
        result.viz_types = VIZ_TYPE.DEFAULT * np.ones(
            shape=(data_dimensions.total_steps, data_dimensions.max_agents)
        )
        for time_index in range(data_dimensions.total_steps):
            new_agent_index = 0
            for agent_index in range(int(n_agents[time_index])):
                if (
                    traj.species_name(type_ids[time_index][agent_index])
                    in input_data.ignore_types
                ):
                    continue
                raw_type_name = traj.species_name(type_ids[time_index][agent_index])
                display_data = (
                    input_data.display_data[raw_type_name]
                    if raw_type_name in input_data.display_data
                    else None
                )
                result.unique_ids[time_index][new_agent_index] = ids[time_index][
                    agent_index
                ]
                result.types[time_index].append(
                    display_data.name if display_data is not None else raw_type_name
                )
                result.positions[time_index][new_agent_index] = (
                    input_data.meta_data.scale_factor
                    * positions[time_index][agent_index]
                )
                result.radii[time_index][new_agent_index] = (
                    display_data.radius
                    if display_data is not None and display_data.radius is not None
                    else 1.0
                )
                new_agent_index += 1
            result.n_agents[time_index] = new_agent_index
        return result

        Pack raw ReaDDy trajectory data into AgentData,
        ignoring particles with type names in ignore_types
        
Pack raw ReaDDy trajectory data into AgentData,
ignoring particles with type names in ignore_types
Pack raw ReaDDy trajectory data into AgentData ignoring particles with type names in ignore_types
def _get_agent_data(
        input_data: ReaddyData,
    ) -> AgentData:
        (
            traj,
            n_agents,
            positions,
            type_ids,
            ids,
        ) = ReaddyConverter._get_raw_trajectory_data(input_data)
        data_dimensions = DimensionData(
            total_steps=n_agents.shape[0],
            max_agents=int(np.amax(n_agents)),
        )
        result = AgentData.from_dimensions(data_dimensions)
        result.times = input_data.timestep * np.arange(data_dimensions.total_steps)
        result.viz_types = VIZ_TYPE.DEFAULT * np.ones(
            shape=(data_dimensions.total_steps, data_dimensions.max_agents)
        )
        for time_index in range(data_dimensions.total_steps):
            new_agent_index = 0
            for agent_index in range(int(n_agents[time_index])):
                if (
                    traj.species_name(type_ids[time_index][agent_index])
                    in input_data.ignore_types
                ):
                    continue
                raw_type_name = traj.species_name(type_ids[time_index][agent_index])
                display_data = (
                    input_data.display_data[raw_type_name]
                    if raw_type_name in input_data.display_data
                    else None
                )
                result.unique_ids[time_index][new_agent_index] = ids[time_index][
                    agent_index
                ]
                result.types[time_index].append(
                    display_data.name if display_data is not None else raw_type_name
                )
                result.positions[time_index][new_agent_index] = (
                    input_data.meta_data.scale_factor
                    * positions[time_index][agent_index]
                )
                result.radii[time_index][new_agent_index] = (
                    display_data.radius
                    if display_data is not None and display_data.radius is not None
                    else 1.0
                )
                new_agent_index += 1
            result.n_agents[time_index] = new_agent_index
        return result
def _get_agent_data ( input_data : ReaddyData , ) -> AgentData : ( traj , n_agents , positions , type_ids , ids , ) = ReaddyConverter . _get_raw_trajectory_data ( input_data ) data_dimensions = DimensionData ( total_steps = n_agents . shape [ 0 ] , max_agents = int ( np . amax ( n_agents ) ) , ) result = AgentData . from_dimensions ( data_dimensions ) result . times = input_data . timestep * np . arange ( data_dimensions . total_steps ) result . viz_types = VIZ_TYPE . DEFAULT * np . ones ( shape = ( data_dimensions . total_steps , data_dimensions . max_agents ) ) for time_index in range ( data_dimensions . total_steps ) : new_agent_index = 0 for agent_index in range ( int ( n_agents [ time_index ] ) ) : if ( traj . species_name ( type_ids [ time_index ] [ agent_index ] ) in input_data . ignore_types ) : continue raw_type_name = traj . species_name ( type_ids [ time_index ] [ agent_index ] ) display_data = ( input_data . display_data [ raw_type_name ] if raw_type_name in input_data . display_data else None ) result . unique_ids [ time_index ] [ new_agent_index ] = ids [ time_index ] [ agent_index ] result . types [ time_index ] . append ( display_data . name if display_data is not None else raw_type_name ) result . positions [ time_index ] [ new_agent_index ] = ( input_data . meta_data . scale_factor * positions [ time_index ] [ agent_index ] ) result . radii [ time_index ] [ new_agent_index ] = ( display_data . radius if display_data is not None and display_data . radius is not None else 1.0 ) new_agent_index += 1 result . n_agents [ time_index ] = new_agent_index return result
Pack raw ReaDDy trajectory data into AgentData,
ignoring particles with type names in ignore_types
Pack raw ReaDDy trajectory data into AgentData ignoring particles with type names in ignore_types
"""
        Pack raw ReaDDy trajectory data into AgentData,
        ignoring particles with type names in ignore_types
        """
input_data
ReaddyData