symforce package¶
The top-level symforce package
Importing this by itself performs minimal initialization configuration, and the functions here are mostly for configuration purposes.
In particular, this primarily performs configuration that you might need before importing
symforce.symbolic
.
- set_log_level(log_level)[source]¶
Set symforce logger level.
The default is INFO, but can be set by one of:
The SYMFORCE_LOGLEVEL environment variable
Calling this function before any other symforce imports
- Parameters:
log_level (
str
) – {DEBUG, INFO, WARNING, ERROR, CRITICAL}- Return type:
None
- set_symbolic_api(name)[source]¶
Set the symbolic API for symforce. The sympy API is the default and pure python, whereas the symengine API is C++ and requires building the symengine library. It can be 100-200 times faster for many operations, but is less fully featured.
The default is symengine if available else sympy, but can be set by one of:
The SYMFORCE_SYMBOLIC_API environment variable
Calling this function before any other symforce imports
- Parameters:
name (
str
) – {sympy, symengine}- Return type:
None
- exception AlreadyUsedEpsilon[source]¶
Bases:
Exception
Exception thrown on attempting to modify the default epsilon after it has been used elsewhere
- set_epsilon_to_symbol(name='epsilon')[source]¶
Set the default epsilon for Symforce to a Symbol.
This must be called before
symforce.symbolic
or other symbolic libraries have been imported. Seesymforce.symbolic.epsilon()
for more information.- Parameters:
name (
str
) – The name of the symbol for the new default epsilon to use- Return type:
None
- set_epsilon_to_number(value=2.220446049250313e-15)[source]¶
Set the default epsilon for Symforce to a number.
This must be called before
symforce.symbolic
or other symbolic libraries have been imported. Seesymforce.symbolic.epsilon()
for more information.- Parameters:
value (
Any
) – The new default epsilon to use- Return type:
None
- set_epsilon_to_zero()[source]¶
Set the default epsilon for Symforce to zero.
This must be called before
symforce.symbolic
or other symbolic libraries have been imported. Seesymforce.symbolic.epsilon()
for more information.- Return type:
None
- set_epsilon_to_invalid()[source]¶
Set the default epsilon for SymForce to
None
. Should not be used to actually create expressions or generate code.This is useful if you’ve forgotten to pass an epsilon somewhere, but are not sure where - using this epsilon in an expression should throw a
TypeError
near the location where you forgot to pass an epsilon.This must be called before
symforce.symbolic
or other symbolic libraries have been imported. Seesymforce.symbolic.epsilon()
for more information.- Return type:
None
Subpackages¶
- symforce.benchmarks package
- symforce.cam package
- Submodules
- symforce.cam.atan_camera_cal module
- symforce.cam.camera module
- symforce.cam.camera_cal module
- symforce.cam.camera_util module
- symforce.cam.double_sphere_camera_cal module
- symforce.cam.equirectangular_camera_cal module
- symforce.cam.linear_camera_cal module
- symforce.cam.polynomial_camera_cal module
- symforce.cam.posed_camera module
- symforce.cam.spherical_camera_cal module
- Submodules
- symforce.codegen package
- Subpackages
- Submodules
- symforce.codegen.cam_package_codegen module
- symforce.codegen.codegen module
- symforce.codegen.codegen_config module
- symforce.codegen.codegen_util module
DenseAndSparseOutputTerms
OutputWithTerms
PrintCodeResult
CSCFormat
print_code()
perform_cse()
format_symbols()
get_formatted_list()
get_formatted_sparse_list()
load_generated_package()
load_generated_function()
load_generated_lcmtype()
get_base_instance()
LcmBindingsDirs
generate_lcm_types()
flat_symbols_from_values()
- symforce.codegen.format_util module
- symforce.codegen.geo_factors_codegen module
- symforce.codegen.geo_package_codegen module
- symforce.codegen.lcm_types_codegen module
- symforce.codegen.ops_codegen_util module
- symforce.codegen.similarity_index module
- symforce.codegen.slam_factors_codegen module
- symforce.codegen.sym_util_package_codegen module
- symforce.codegen.template_util module
- symforce.codegen.types_package_codegen module
- symforce.codegen.values_codegen module
- symforce.examples package
- Subpackages
- symforce.examples.bundle_adjustment package
- symforce.examples.bundle_adjustment_fixed_size package
- symforce.examples.bundle_adjustment_in_the_large package
- symforce.examples.custom_factor_generation package
- symforce.examples.robot_2d_localization package
- symforce.examples.robot_3d_localization package
- Subpackages
- symforce.geo package
- Subpackages
- Submodules
- symforce.geo.complex module
- symforce.geo.dual_quaternion module
- symforce.geo.matrix module
Matrix
Matrix11
Matrix21
Matrix31
Matrix41
Matrix51
Matrix61
Matrix71
Matrix81
Matrix91
Matrix12
Matrix22
Matrix32
Matrix42
Matrix52
Matrix62
Matrix72
Matrix82
Matrix92
Matrix13
Matrix23
Matrix33
Matrix43
Matrix53
Matrix63
Matrix73
Matrix83
Matrix93
Matrix14
Matrix24
Matrix34
Matrix44
Matrix54
Matrix64
Matrix74
Matrix84
Matrix94
Matrix15
Matrix25
Matrix35
Matrix45
Matrix55
Matrix65
Matrix75
Matrix85
Matrix95
Matrix16
Matrix26
Matrix36
Matrix46
Matrix56
Matrix66
Matrix76
Matrix86
Matrix96
Matrix17
Matrix27
Matrix37
Matrix47
Matrix57
Matrix67
Matrix77
Matrix87
Matrix97
Matrix18
Matrix28
Matrix38
Matrix48
Matrix58
Matrix68
Matrix78
Matrix88
Matrix98
Matrix19
Matrix29
Matrix39
Matrix49
Matrix59
Matrix69
Matrix79
Matrix89
Matrix99
m
matrix_type_from_shape()
M
Vector1
Vector2
Vector3
Vector4
Vector5
Vector6
Vector7
Vector8
Vector9
V1
V2
V3
V4
V5
V6
V7
V8
V9
M11
M21
M31
M41
M51
M61
M71
M81
M91
M12
M22
M32
M42
M52
M62
M72
M82
M92
M13
M23
M33
M43
M53
M63
M73
M83
M93
M14
M24
M34
M44
M54
M64
M74
M84
M94
M15
M25
M35
M45
M55
M65
M75
M85
M95
M16
M26
M36
M46
M56
M66
M76
M86
M96
M17
M27
M37
M47
M57
M67
M77
M87
M97
M18
M28
M38
M48
M58
M68
M78
M88
M98
M19
M29
M39
M49
M59
M69
M79
M89
M99
I1()
I11()
I2()
I22()
I3()
I33()
I4()
I44()
I5()
I55()
I6()
I66()
I7()
I77()
I8()
I88()
I9()
I99()
- symforce.geo.pose2 module
- symforce.geo.pose3 module
- symforce.geo.quaternion module
- symforce.geo.rot2 module
- symforce.geo.rot3 module
- symforce.geo.unit3 module
- symforce.internal package
- symforce.ops package
- symforce.opt package
- Subpackages
- Submodules
- symforce.opt.barrier_functions module
- symforce.opt.factor module
- symforce.opt.noise_models module
- symforce.opt.numeric_factor module
- symforce.opt.objective module
- symforce.opt.optimization_problem module
- symforce.opt.optimizer module
- symforce.opt.residual_block module
- symforce.opt.sub_problem module
- symforce.opt.timestep_sub_problem module
- symforce.slam package
- symforce.test_util package
- Subpackages
- Submodules
- symforce.test_util.backend_coverage_expressions module
- symforce.test_util.cam_cal_test_mixin module
- symforce.test_util.cam_test_mixin module
- symforce.test_util.epsilon_handling module
- symforce.test_util.group_ops_test_mixin module
- symforce.test_util.lie_group_ops_test_mixin module
- symforce.test_util.storage_ops_test_mixin module
- symforce.test_util.test_case module
- symforce.test_util.test_case_mixin module
- symforce.values package
Submodules¶
- symforce.cc_sym module
Factor
Key
Linearization
OptimizationStats
OptimizationStats.__init__()
OptimizationStats.best_index
OptimizationStats.best_linearization
OptimizationStats.cholesky_factor_sparsity
OptimizationStats.failure_reason
OptimizationStats.get_lcm_type()
OptimizationStats.iterations
OptimizationStats.jacobian_sparsity
OptimizationStats.linear_solver_ordering
OptimizationStats.status
Optimizer
Values
Values.__init__()
Values.at()
Values.cleanup()
Values.create_index()
Values.data()
Values.empty()
Values.get_lcm_type()
Values.has()
Values.items()
Values.keys()
Values.local_coordinates()
Values.num_entries()
Values.remove()
Values.remove_all()
Values.retract()
Values.set()
Values.update()
Values.update_or_set()
default_optimizer_params()
optimize()
set_log_level()
- symforce.databuffer module
DataBuffer
DataBuffer.default_assumptions
DataBuffer.is_algebraic
DataBuffer.is_commutative
DataBuffer.is_complex
DataBuffer.is_composite
DataBuffer.is_even
DataBuffer.is_extended_negative
DataBuffer.is_extended_nonnegative
DataBuffer.is_extended_nonpositive
DataBuffer.is_extended_nonzero
DataBuffer.is_extended_positive
DataBuffer.is_extended_real
DataBuffer.is_imaginary
DataBuffer.is_integer
DataBuffer.is_irrational
DataBuffer.is_negative
DataBuffer.is_noninteger
DataBuffer.is_nonnegative
DataBuffer.is_nonpositive
DataBuffer.is_nonzero
DataBuffer.is_odd
DataBuffer.is_positive
DataBuffer.is_prime
DataBuffer.is_rational
DataBuffer.is_real
DataBuffer.is_transcendental
DataBuffer.is_zero
- symforce.jacobian_helpers module
- symforce.logic module
- symforce.notebook_util module
- symforce.path_util module
- symforce.python_util module
remove_if_exists()
execute_subprocess()
camelcase_to_snakecase()
snakecase_to_camelcase()
camelcase_to_screaming_snakecase()
str_replace_all()
str_removeprefix()
str_removesuffix()
files_in_dir()
id_generator()
getattr_recursive()
InvalidKeyError
InvalidPythonIdentifierError
base_and_indices()
plural()
get_func_from_maybe_bound_function()
get_class_for_method()
AttrDict
- symforce.symbolic module
Abs
Add
Basic
Basic.args
Basic.args_as_sage()
Basic.args_as_sympy()
Basic.as_coefficients_dict()
Basic.as_numer_denom()
Basic.as_real_imag()
Basic.atoms()
Basic.coeff()
Basic.copy()
Basic.diff()
Basic.evalf()
Basic.expand()
Basic.free_symbols
Basic.has()
Basic.is_Add
Basic.is_AlgebraicNumber
Basic.is_Atom
Basic.is_Boolean
Basic.is_DataBufferElement
Basic.is_Derivative
Basic.is_Dummy
Basic.is_Equality
Basic.is_Float
Basic.is_Function
Basic.is_Integer
Basic.is_Matrix
Basic.is_Mul
Basic.is_Not
Basic.is_Number
Basic.is_Pow
Basic.is_Rational
Basic.is_Relational
Basic.is_Symbol
Basic.is_finite
Basic.is_integer
Basic.is_negative
Basic.is_nonnegative
Basic.is_nonpositive
Basic.is_number
Basic.is_positive
Basic.is_real
Basic.is_symbol
Basic.is_zero
Basic.msubs()
Basic.n()
Basic.replace()
Basic.simplify()
Basic.subs()
Basic.subs_dict()
Basic.subs_oldnew()
Basic.xreplace()
Contains
Derivative
Dummy
Expr
FiniteSet
Float
Function
Integer
Interval
KroneckerDelta
LambertW
LeviCivita
Max
Min
Mod()
Mul
Number
Piecewise
Pow
Rational
RealNumber
Subs
SympifyError
UnevaluatedExpr
acos
acosh
acot
acoth
acsc
acsch
asec
asech
asin
asinh
atan
atanh
beta
ceiling
conjugate
cos
cosh
cot
coth
csc
csch
cse()
diff()
digamma()
dirichlet_eta
erf
erfc
exp()
expand()
floor
gamma()
init_printing()
integer_nthroot()
isprime()
lambdify()
latex()
linsolve()
log
loggamma
lowergamma
perfect_power()
polygamma
sec
sech
series()
sign
sin
sinh
sqrt()
sqrt_mod()
sympify()
tan
tanh
trigamma()
uppergamma
var()
zeta
epsilon()
Symbol
original_symbols()
symbols()
Scalar
is_positive()
is_negative()
is_nonnegative()
is_nonpositive()
less_equal()
greater_equal()
less()
greater()
logical_and()
logical_or()
logical_not()
wrap_angle()
angle_diff()
sign_no_zero()
copysign_no_zero()
argmax_onehot()
argmax()
atan2()
asin_safe()
acos_safe()
clamp()
set_eval_on_sympify()
simplify()
limit()
solve()
count_ops()
DataBuffer
original_get_dict()
create_named_scope()
set_scope()
get_scope()
scope()
Complex
Complex.__init__()
Complex.storage_dim()
Complex.to_storage()
Complex.from_storage()
Complex.symbolic()
Complex.identity()
Complex.compose()
Complex.inverse()
Complex.zero()
Complex.conj()
Complex.squared_norm()
Complex.__mul__()
Complex.__add__()
Complex.__neg__()
Complex.__div__()
Complex.__truediv__()
Complex.random_uniform()
Complex.unit_random()
Complex.unit_random_from_uniform_sample()
DualQuaternion
DualQuaternion.__init__()
DualQuaternion.storage_dim()
DualQuaternion.to_storage()
DualQuaternion.from_storage()
DualQuaternion.identity()
DualQuaternion.compose()
DualQuaternion.inverse()
DualQuaternion.__mul__()
DualQuaternion.__div__()
DualQuaternion.__truediv__()
DualQuaternion.squared_norm()
DualQuaternion.conj()
Storage
Matrix
Matrix.MatrixT
Matrix.SHAPE
Matrix.__new__()
Matrix.__init__()
Matrix.rows
Matrix.cols
Matrix.shape
Matrix.is_Matrix
Matrix.storage_dim()
Matrix.from_storage()
Matrix.to_storage()
Matrix.tangent_dim()
Matrix.from_tangent()
Matrix.to_tangent()
Matrix.storage_D_tangent()
Matrix.tangent_D_storage()
Matrix.zero()
Matrix.zeros()
Matrix.one()
Matrix.ones()
Matrix.diag()
Matrix.eye()
Matrix.det()
Matrix.inv()
Matrix.symbolic()
Matrix.row_join()
Matrix.col_join()
Matrix.block_matrix()
Matrix.simplify()
Matrix.limit()
Matrix.jacobian()
Matrix.diff()
Matrix.T
Matrix.transpose()
Matrix.lower_triangle()
Matrix.reshape()
Matrix.dot()
Matrix.cross()
Matrix.squared_norm()
Matrix.norm()
Matrix.normalized()
Matrix.clamp_norm()
Matrix.multiply_elementwise()
Matrix.applyfunc()
Matrix.__getitem__()
Matrix.row()
Matrix.col()
Matrix.__neg__()
Matrix.__add__()
Matrix.__sub__()
Matrix.__mul__()
Matrix.__rmul__()
Matrix.__div__()
Matrix.compute_AtA()
Matrix.LU()
Matrix.LDL()
Matrix.FFLU()
Matrix.FFLDU()
Matrix.solve()
Matrix.__truediv__()
Matrix.are_parallel()
Matrix.skew_symmetric()
Matrix.evalf()
Matrix.to_list()
Matrix.to_flat_list()
Matrix.from_flat_list()
Matrix.to_numpy()
Matrix.column_stack()
Matrix.is_vector()
Matrix.init_printing()
Matrix11
Matrix21
Matrix31
Matrix41
Matrix51
Matrix61
Matrix71
Matrix81
Matrix91
Matrix12
Matrix22
Matrix32
Matrix42
Matrix52
Matrix62
Matrix72
Matrix82
Matrix92
Matrix13
Matrix23
Matrix33
Matrix43
Matrix53
Matrix63
Matrix73
Matrix83
Matrix93
Matrix14
Matrix24
Matrix34
Matrix44
Matrix54
Matrix64
Matrix74
Matrix84
Matrix94
Matrix15
Matrix25
Matrix35
Matrix45
Matrix55
Matrix65
Matrix75
Matrix85
Matrix95
Matrix16
Matrix26
Matrix36
Matrix46
Matrix56
Matrix66
Matrix76
Matrix86
Matrix96
Matrix17
Matrix27
Matrix37
Matrix47
Matrix57
Matrix67
Matrix77
Matrix87
Matrix97
Matrix18
Matrix28
Matrix38
Matrix48
Matrix58
Matrix68
Matrix78
Matrix88
Matrix98
Matrix19
Matrix29
Matrix39
Matrix49
Matrix59
Matrix69
Matrix79
Matrix89
Matrix99
m
matrix_type_from_shape()
M
Vector1
Vector2
Vector3
Vector4
Vector5
Vector6
Vector7
Vector8
Vector9
V1
V2
V3
V4
V5
V6
V7
V8
V9
M11
M21
M31
M41
M51
M61
M71
M81
M91
M12
M22
M32
M42
M52
M62
M72
M82
M92
M13
M23
M33
M43
M53
M63
M73
M83
M93
M14
M24
M34
M44
M54
M64
M74
M84
M94
M15
M25
M35
M45
M55
M65
M75
M85
M95
M16
M26
M36
M46
M56
M66
M76
M86
M96
M17
M27
M37
M47
M57
M67
M77
M87
M97
M18
M28
M38
M48
M58
M68
M78
M88
M98
M19
M29
M39
M49
M59
M69
M79
M89
M99
I1()
I11()
I2()
I22()
I3()
I33()
I4()
I44()
I5()
I55()
I6()
I66()
I7()
I77()
I8()
I88()
I9()
I99()
VectorClassLieGroupOps
Pose2
Pose2.Pose2T
Pose2.__init__()
Pose2.rotation()
Pose2.position()
Pose2.storage_dim()
Pose2.to_storage()
Pose2.from_storage()
Pose2.identity()
Pose2.compose()
Pose2.inverse()
Pose2.tangent_dim()
Pose2.from_tangent()
Pose2.to_tangent()
Pose2.storage_D_tangent()
Pose2.tangent_D_storage()
Pose2.retract()
Pose2.local_coordinates()
Pose2.__mul__()
Pose2.to_homogenous_matrix()
Pose3
Pose3.Pose3T
Pose3.__init__()
Pose3.rotation()
Pose3.position()
Pose3.storage_dim()
Pose3.to_storage()
Pose3.from_storage()
Pose3.symbolic()
Pose3.identity()
Pose3.compose()
Pose3.inverse()
Pose3.tangent_dim()
Pose3.from_tangent()
Pose3.to_tangent()
Pose3.storage_D_tangent()
Pose3.tangent_D_storage()
Pose3.retract()
Pose3.local_coordinates()
Pose3.__mul__()
Pose3.to_homogenous_matrix()
Quaternion
Quaternion.__init__()
Quaternion.x
Quaternion.y
Quaternion.z
Quaternion.storage_dim()
Quaternion.to_storage()
Quaternion.from_storage()
Quaternion.symbolic()
Quaternion.identity()
Quaternion.compose()
Quaternion.inverse()
Quaternion.__mul__()
Quaternion.__neg__()
Quaternion.__add__()
Quaternion.__div__()
Quaternion.__truediv__()
Quaternion.zero()
Quaternion.squared_norm()
Quaternion.conj()
Quaternion.unit_random()
Quaternion.unit_random_from_uniform_samples()
Rot2
Rot2.__init__()
Rot2.storage_dim()
Rot2.to_storage()
Rot2.from_storage()
Rot2.symbolic()
Rot2.identity()
Rot2.compose()
Rot2.inverse()
Rot2.tangent_dim()
Rot2.from_tangent()
Rot2.to_tangent()
Rot2.hat()
Rot2.storage_D_tangent()
Rot2.tangent_D_storage()
Rot2.__mul__()
Rot2.from_angle()
Rot2.to_rotation_matrix()
Rot2.random()
Rot2.random_from_uniform_sample()
Rot3
Rot3.__init__()
Rot3.storage_dim()
Rot3.to_storage()
Rot3.from_storage()
Rot3.symbolic()
Rot3.identity()
Rot3.compose()
Rot3.inverse()
Rot3.tangent_dim()
Rot3.from_tangent()
Rot3.to_tangent()
Rot3.hat()
Rot3.storage_D_tangent()
Rot3.tangent_D_storage()
Rot3.__mul__()
Rot3.to_rotation_matrix()
Rot3.from_rotation_matrix()
Rot3.to_yaw_pitch_roll()
Rot3.from_yaw_pitch_roll()
Rot3.from_angle_axis()
Rot3.from_two_unit_vectors()
Rot3.angle_between()
Rot3.random()
Rot3.random_from_uniform_samples()
Unit3
Unit3.E_Z
Unit3.__init__()
Unit3.storage_dim()
Unit3.to_storage()
Unit3.from_storage()
Unit3.symbolic()
Unit3.identity()
Unit3.compose()
Unit3.inverse()
Unit3.tangent_dim()
Unit3.from_tangent()
Unit3.to_tangent()
Unit3.storage_D_tangent()
Unit3.tangent_D_storage()
Unit3.to_rotation()
Unit3.to_unit_vector()
Unit3.from_vector()
Unit3.random()
ATANCameraCal
Camera
CameraCal
CameraCal.CameraCalT
CameraCal.NUM_DISTORTION_COEFFS
CameraCal.__init__()
CameraCal.from_distortion_coeffs()
CameraCal.storage_order()
CameraCal.storage_dim()
CameraCal.to_storage()
CameraCal.from_storage()
CameraCal.symbolic()
CameraCal.parameters()
CameraCal.pixel_from_camera_point()
CameraCal.camera_ray_from_pixel()
CameraCal.has_camera_ray_from_pixel()
DoubleSphereCameraCal
EquirectangularCameraCal
LinearCameraCal
PolynomialCameraCal
PolynomialCameraCal.NUM_DISTORTION_COEFFS
PolynomialCameraCal.DEFAULT_MAX_FOV
PolynomialCameraCal.__init__()
PolynomialCameraCal.from_distortion_coeffs()
PolynomialCameraCal.storage_order()
PolynomialCameraCal.pixel_from_camera_point()
PolynomialCameraCal.camera_ray_from_pixel()
PolynomialCameraCal.storage_dim()
PolynomialCameraCal.to_storage()
PolynomialCameraCal.from_storage()
PolynomialCameraCal.symbolic()
PosedCamera
SphericalCameraCal
SphericalCameraCal.NUM_DISTORTION_COEFFS
SphericalCameraCal.__init__()
SphericalCameraCal.from_distortion_coeffs()
SphericalCameraCal.storage_order()
SphericalCameraCal.storage_dim()
SphericalCameraCal.to_storage()
SphericalCameraCal.from_storage()
SphericalCameraCal.symbolic()
SphericalCameraCal.pixel_from_camera_point()
SphericalCameraCal.camera_ray_from_pixel()
- symforce.type_helpers module
- symforce.typing module
- symforce.typing_util module
- symforce.util module