NarupaFrame¶
-
class
narupatools.frame.frame.NarupaFrame(raw_frame: Optional[narupa.protocol.trajectory.frame_pb2.FrameData] = None)¶ Wrapper around a protobuf FrameData.
This subclass explicitly is an implementation of a mutable mapping between string keys and arbitrary values.
Inheritance

Methods
Initialize self.
Get the value for a given key, returning value if the key is not present.
Get a float value with a given key.
Get a string value with a given key.
Iterate over the keys and values of the Frame.
Iterate over the keys of the Frame.
Set an homogeneous array of floats in an existing or a new key.
Set a single float value with the given key.
Set an homogeneous array of indices in an existing or a new key.
Set an homogeneous array of strings in an existing or a new key.
Set a single string value with the given key.
Iterate over the values of the Frame.
-
__init__(raw_frame: Optional[narupa.protocol.trajectory.frame_pb2.FrameData] = None)¶ Initialize self. See help(type(self)) for accurate signature.
-
get(key: narupatools.frame.fields.FrameKey[TFrom, TTo]) → TTo¶ -
get(key: narupatools.frame.fields.FrameKey[TFrom, TTo], value: Optional[TDefault] = None) → Union[TTo, TDefault] -
get(key: str, value: Optional[TDefault] = None) → Any Get the value for a given key, returning value if the key is not present.
- Parameters
key – Key to lookup.
value – Default value to use if the key is absent.
- Returns
The value for the given key if it is present, otherwise the default return value.
-
get_float_value(key: str) → float¶ Get a float value with a given key.
- Parameters
key – Key to lookup.
- Returns
String value for the given key.
- Raises
KeyError – Given key is absent in this frame.
-
get_string_value(key: str) → str¶ Get a string value with a given key.
- Parameters
key – Key to lookup.
- Returns
String value for the given key.
- Raises
KeyError – Given key is absent in this frame.
-
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_float_value(key: str, value: SupportsFloat) → None¶ Set a single float value with the given key.
- Parameters
key – Key to set.
value – Value to set.
-
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.
-
set_string_value(key: str, value: Any) → None¶ Set a single string value with the given key.
- Parameters
key – Key to set.
value – Value to set.
Attributes
Underlying GRPC/protobuf object.
-
array_keys¶
-
raw¶ Underlying GRPC/protobuf object.
-
shortcuts¶
-
used_shortcuts¶
-
value_keys¶
-