simulariumio.filters package

Submodules

simulariumio.filters.add_agents_filter module

class simulariumio.filters.add_agents_filter.AddAgentsFilter(new_agent_data: AgentData)[source]

Bases: Filter

This filter adds the given agents to each frame of the simulation

Parameters:
new_agent_dataAgentData

agent data to append to the trajectory

apply(data: TrajectoryData) TrajectoryData[source]

Add the given agents to each frame of the simularium data

new_agent_data: AgentData

simulariumio.filters.every_nth_agent_filter module

class simulariumio.filters.every_nth_agent_filter.EveryNthAgentFilter(n_per_type: Dict[str, int], default_n: int = 1)[source]

Bases: Filter

This filter reduces the number of agents in each frame of simularium data by filtering out all but every nth agent

Parameters:
n_per_typeDict[str, int]

N for agents of each type, keep every nth agent of that type, filter out all the others

default_nint (optional)

N for any agents of type not specified in n_per_type Default: 1

apply(data: TrajectoryData) TrajectoryData[source]

Reduce the number of agents in each frame of the simularium data by filtering out all but every nth agent

default_n: int
n_per_type: Dict[str, int]

simulariumio.filters.every_nth_subpoint_filter module

class simulariumio.filters.every_nth_subpoint_filter.EveryNthSubpointFilter(n_per_type: Dict[str, int], default_n: int = 1)[source]

Bases: Filter

This filter reduces the number of subpoints in each frame of simularium data

Parameters:
n_per_typeDict[str, int]

N for agents of each type, keep every nth subpoint for that type (if subpoints exist), filter out all the others

default_nint (optional)

N for any agents of type not specified in n_per_type Default: 1

apply(data: TrajectoryData) TrajectoryData[source]

Reduce the number of subpoints in each frame of the simularium data by filtering out all but every nth subpoint

default_n: int
n_per_type: Dict[str, int]

simulariumio.filters.every_nth_timestep_filter module

class simulariumio.filters.every_nth_timestep_filter.EveryNthTimestepFilter(n: int)[source]

Bases: Filter

This filter reduces the number of timesteps in simularium data

Parameters:
nint

keep every nth time step, filter out all the others

apply(data: TrajectoryData) TrajectoryData[source]

Reduce the number of timesteps in each frame of the simularium data by filtering out all but every nth timestep

n: int

simulariumio.filters.filter module

class simulariumio.filters.filter.Filter[source]

Bases: ABC

abstract apply(data: TrajectoryData) TrajectoryData[source]
static get_items_from_subpoints(agent_data: AgentData, time_index: int, agent_index: int) ndarray[source]

Reshape the subpoints array by the items represented

simulariumio.filters.multiply_space_filter module

class simulariumio.filters.multiply_space_filter.MultiplySpaceFilter(multiplier: float)[source]

Bases: Filter

This filter scales all spatial data by a supplied multiplier

Parameters:
multiplierfloat

float by which to multiply spatial values

apply(data: TrajectoryData) TrajectoryData[source]

Multiply spatial values in the data

multiplier: float

simulariumio.filters.multiply_time_filter module

class simulariumio.filters.multiply_time_filter.MultiplyTimeFilter(multiplier: float, apply_to_plots: bool = True)[source]

Bases: Filter

This filter scales the time-stamp values for each simulation frame by a provided multiplier

Parameters:
multiplierfloat

float by which to multiply time values

apply_to_plotsbool (optional)

also multiply time values in plot data? Default = True

apply(data: TrajectoryData) TrajectoryData[source]

Multiply time values in the data

apply_to_plots: bool
multiplier: float

simulariumio.filters.transform_spatial_axes_filter module

class simulariumio.filters.transform_spatial_axes_filter.TransformSpatialAxesFilter(axes_mapping: List[str])[source]

Bases: Filter

This filter transforms spatial axes to rotate and/or reflect the scene in each frame of simularium data

Parameters:
axes_mappingList[str]

a list describing how to remap the axes e.g. [“+X”, “-Z”, “+Y”] for [+X, +Y, +Z] -> [+X, -Z, +Y] e.g. [“-Z”, “-Y”, “+X”] for [+X, +Y, +Z] -> [-Z, -Y, +X]

apply(data: TrajectoryData) TrajectoryData[source]

Transform spatial coordinates to rotate and/or reflect the scene

axes_mapping: List[str]

simulariumio.filters.translate_filter module

class simulariumio.filters.translate_filter.TranslateFilter(translation_per_type: Dict[str, ndarray] | None = None, default_translation: ndarray = array([0., 0., 0.]))[source]

Bases: Filter

This object contains parameters for translating 3D positions in each frame of simularium data

Parameters:
translation_per_typeDict[str, int]

translation for agents of each type Default: {}

default_translationint

translation for any agent types not specified in translation_per_type Default: np.zeros(3)

apply(data: TrajectoryData) TrajectoryData[source]

Add the XYZ translation to all spatial coordinates

default_translation: ndarray
translation_per_type: Dict[str, ndarray]

Module contents