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 the values attribute, while the later is accessible through the arrays one. Both attribute behave like a dictionary. Trying to access a key that does not exist raises a KeyError.

The set of keys with data in the frame is listed by value_keys() and array_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 a KeyError.

The available shortcuts can be listed using the shortcuts property. The set of shortcuts that contain data is available from the used_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 raw: FrameData

Underlying GRPC/protobuf object.

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.

class nanover.trajectory.frame_data.RecordView(raw)

Bases: object

Base class that wraps the access to a kind of record.

This class needs to be subclassed.

delete(key)
get(key, default=None)
keys() Set
record_name: str | None = None
set(key, value)
singular: str | None = None
class nanover.trajectory.frame_data.ValuesView(raw)

Bases: RecordView

Give access to singular values from a FrameData.

record_name: str | None = 'values'
set(key: str, value)
singular: str | None = 'value'