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 (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:

list – 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:
Return type:

Any

static symbolic(a, name, **kwargs)[source]#

Construct a symbolic element with the given name prefix.

Parameters:
  • a (Any | Type) –

  • name (str) – String prefix

  • kwargs (Dict) – Additional arguments to pass to sf.Symbol (like assumptions)

Returns:

Storage

Return type:

Any

static evalf(a)[source]#

Evaluate to a numerical quantity (rationals, trig functions, etc).

Parameters:

a (Any) –

Return type:

Any

static subs(a, *args, **kwargs)[source]#
Parameters:
  • a (Any) –

  • args (Any) –

  • kwargs (Any) –

Return type:

Any

static simplify(a)[source]#
Parameters:

a (Any) –

Return type:

Any