session.MNSession

session.MNSession(self)

Attributes

Name Description
n_items The number of items being tracked by this session.

Methods

Name Description
add_trajectory Add a new trajectory
clear Remove references to all molecules, trajectories and ensembles.
get_object Try and get an object from Blender’s object database that matches the uuid given.
get_trajectory Get trajectory instance by name
prune Remove any entities that no longer exist in Blender
register_entity Add entity to the dictionary
remove Remove an entity by uuid
remove_entity Remove entity from the dictionary
remove_trajectory Remove an existing trajectory

add_trajectory

session.MNSession.add_trajectory(
    universe,
    style='vdw',
    name='NewUniverseObject',
)

Add a new trajectory

Parameters

Name Type Description Default
universe mda.Universe | AtomGroup MDAnalysis Universe or AtomGroup instance required
style str | None The style to apply to the Universe or AtomGroup. 'vdw'
name str Name of the trajectory object in Blender 'NewUniverseObject'

Returns

Name Type Description
Trajectory The newly added Trajectory instance

clear

session.MNSession.clear()

Remove references to all molecules, trajectories and ensembles.

get_object

session.MNSession.get_object(uuid)

Try and get an object from Blender’s object database that matches the uuid given.

If nothing is be found to match, return None.

get_trajectory

session.MNSession.get_trajectory(name)

Get trajectory instance by name

Parameters

Name Type Description Default
name str Name of the trajectory object required

Returns

Name Type Description
Trajectory A Trajectory instance

Raises

Name Type Description
ValueError if trajectory is not found

prune

session.MNSession.prune()

Remove any entities that no longer exist in Blender

register_entity

session.MNSession.register_entity(item)

Add entity to the dictionary

remove

session.MNSession.remove(uuid)

Remove an entity by uuid

remove_entity

session.MNSession.remove_entity(uuid)

Remove entity from the dictionary

remove_trajectory

session.MNSession.remove_trajectory(trajectory)

Remove an existing trajectory

Parameters

Name Type Description Default
trajectory Trajectory | str A Trajectory instance or name of the trajectory required

Returns

Name Type Description
None

Raises

Name Type Description
ValueError if trajectory name is not found