nanover.trajectory.frame_data module
- class nanover.trajectory.frame_data.ArraysView(raw)
Bases:
RecordView
Give access to homogeneous arrays from a
FrameData
.- record_name: str | None = 'arrays'
- set(key: str, value)
- singular: str | None = 'array'
- class nanover.trajectory.frame_data.FrameData(raw_frame: FrameData = None)
Bases:
object
Wrapper around the GRPC FrameData.
A
FrameData
contains two kinds of records: single values of any type, or homogeneous arrays. The former kind can be accessed through thevalues
attribute, while the later is accessible through thearrays
one. Both attribute behave like a dictionary. Trying to access a key that does not exist raises aKeyError
.The set of keys with data in the frame is listed by
value_keys()
andarray_keys()
.The most common frame properties are accessible as attribute in a normalized format. Shortcuts are not guaranteed to contain data. Trying to access a shortcut that does not contain data raises a
MissingDataError
that can also be caught as aKeyError
.The available shortcuts can be listed using the
shortcuts
property. The set of shortcuts that contain data is available from theused_shortcuts
.- property array_keys: Set
- property bond_orders
- property bond_pairs
- property box_vectors
- property chain_count
- property chain_names
- copy()
- property kinetic_energy
- property particle_count
- property particle_elements
- property particle_forces
- property particle_forces_system
- property particle_names
- property particle_positions
- property particle_residues
- property particle_velocities
- property potential_energy
- property residue_chains
- property residue_count
- property residue_ids
- property residue_names
- property server_timestamp
- set_float_array(key, value)
Set an homogeneous array of floats in an existing or a new key.
- Parameters:
key – The key under which to store the array.
value – The array to store.
- set_index_array(key, value)
Set an homogeneous array of indices in an existing or a new key.
- Parameters:
key – The key under which to store the array.
value – The array to store.
- set_string_array(key, value)
Set an homogeneous array of strings in an existing or a new key.
- Parameters:
key – The key under which to store the array.
value – The array to store.
- property shortcuts: Set
- property simulation_counter
- property simulation_time
- property used_shortcuts: Set
- property user_energy
- property user_forces_index
- property user_forces_sparse
- property user_work_done
- property value_keys: Set
- exception nanover.trajectory.frame_data.MissingDataError
Bases:
KeyError
A shortcut does not contain data to return.