nanover.trajectory.frame_dict module
- nanover.trajectory.frame_dict.FRAME_PACKERS: dict[str, PackingPair] = {'bond.orders': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'bond.pairs': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'chain.count': PackingPair(pack=<class 'int'>, unpack=<class 'int'>), 'forces.user.index': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'forces.user.sparse': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'frame.index': PackingPair(pack=<class 'int'>, unpack=<class 'int'>), 'particle.count': PackingPair(pack=<class 'int'>, unpack=<class 'int'>), 'particle.elements': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'particle.forces': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'particle.forces.system': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'particle.positions': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'particle.residues': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'particle.velocities': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'residue.chains': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>), 'residue.count': PackingPair(pack=<class 'int'>, unpack=<class 'int'>), 'system.box.vectors': PackingPair(pack=<function make_bytes_packer.<locals>.<lambda>>, unpack=<function make_bytes_packer.<locals>.<lambda>>)}
Mapping of framedata keys to the packer used to pack/unpack between rich data and data ready for MessagePack
- nanover.trajectory.frame_dict.frame_dict_packer = PackingPair(pack=<function _pack_frame_dict>, unpack=<function _unpack_frame_dict>)
Pair of functions for packing/unpacking frame data dictionaries of complex types into dictionaries of simpler MessagePack types.
- nanover.trajectory.frame_dict.merge_frame_dicts(a: dict[str, Any], b: dict[str, Any])
Merge two frame dictionaries, taking all the data of the two frames, preferring data from the second where they overlap. Key “frame.index” == 0 is treated as a frame reset whose presence in either frame is propagated to the merged frame, and whose presence in the second frame means the data from first frame should be discarded.