symforce.ops.storage_ops module¶
- class StorageOps[source]¶
Bases:
Ops
API for symbolic data types that can be serialized to and from a vector of scalar quantities.
- static storage_dim(a)[source]¶
Size of the element’s storage, aka the number of scalar values it contains.
- Parameters:
a (
Union
[Any
,Type
]) –- Return type:
int
- static to_storage(a)[source]¶
Serialization of the underlying storage into a list. This is NOT a tangent space.
- Parameters:
a (
Any
) –- Returns:
Length equal to storage_dim(a)
- Return type:
list
- static from_storage(a, elements)[source]¶
Construct from a flat list representation. Opposite of .to_storage().
- Parameters:
a (
Union
[Any
,Type
]) –elements (
Sequence
[float
]) –
- Return type:
Any
- static symbolic(a, name, **kwargs)[source]¶
Construct a symbolic element with the given name prefix.
- Parameters:
a (
Union
[Any
,Type
]) –name (
str
) – String prefixkwargs (
Dict
) – Additional arguments to pass to sf.Symbol (like assumptions)
- Return type:
- static evalf(a)[source]¶
Evaluate to a numerical quantity (rationals, trig functions, etc).
- Parameters:
a (
Any
) –- Return type:
Any