FrameKey¶
-
class
narupatools.frame.fields.FrameKey(key: str)¶ Key that can be placed in a Narupa FrameData, such as positions or potential energy.
This allows custom keys to be more easily defined, instead of the hardcoded shortcuts of the original Narupa FrameData.
Inheritance

Methods
Initialize self.
Get the value of the given frame data for this key.
Get the value for this key, returning a default value if the key is absent.
Insert the value into the given frame data for this key.
-
get(frame_data: narupa.trajectory.frame_data.FrameData, /, *, calculate: bool = False) → _TTo¶ Get the value of the given frame data for this key.
- Parameters
frame_data – FrameData to lookup.
calculate – Calculate the value based on other keys available.
- Raises
KeyError – Given key is not available.
-
get_with_default(frame_data: narupa.trajectory.frame_data.FrameData, /, default: _TDefault, *, calculate: bool = False) → Union[_TTo, _TDefault]¶ Get the value for this key, returning a default value if the key is absent.
- Parameters
frame_data – FrameData to look up key in.
default – Default value to return if absent.
calculate – Calculate the value based on other keys available.
-
abstract
set(frame_data: narupa.trajectory.frame_data.FrameData, value: _TFrom) → None¶ Insert the value into the given frame data for this key.
- Parameters
frame_data – FrameData to modify.
value – Value to insert.
-