symforce.type_helpers module¶
- deduce_input_type(parameter, func, is_first_parameter)[source]¶
Attempt to deduce the type of an input parameter to a function
Strategy:
If it’s annotated with something, return that
If it’s the first parameter and its name is “self”, search for a type by the class part of the function’s qualified name
- deduce_input_types(func)[source]¶
Attempt to deduce input types from the type annotations on func, to be used by
Codegen.function
.See the docstring on
deduce_input_type()
for deduction strategy
- symbolic_inputs(func, input_types=None)[source]¶
Return symbolic arguments for the inputs to
func
- Parameters:
func (Callable) – A callable; args should have type annotations, and those types should be constructible automatically with
symforce.ops.storage_ops.StorageOps.symbolic()
- Returns:
A tuple with a symbolic object for each input to func
- Return type:
See also:
sf.util.symbolic_eval