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
See the SymPy tutorial for information on the symbolic APIs that can be used: https://symforce.org/tutorials/sympy_tutorial.html
By default, SymForce will use the
symengine
API if it is available. If the symbolic API is set tosympy
it will use that. Ifsymengine
is not available and the symbolic API was not set, it will emit a warning and use thesympy
API.The symbolic API can be set by one of:
The
SYMFORCE_SYMBOLIC_API
environment variableCalling this function before any other symforce imports
- Parameters:
name (str) – {sympy, symengine}
- Return type:
None
- get_symbolic_api()[source]#
Return the current symbolic API as a string.
- Return type:
Literal[‘sympy’, ‘symengine’]
- exception AlreadyUsedEpsilon[source]#
Bases:
Exception
Exception thrown on attempting to modify the default epsilon after it has been used elsewhere
- class SymbolicEpsilon(name)[source]#
Bases:
object
An indicator that SymForce should use a symbolic epsilon
- Parameters:
name (str) –
- 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.optimizer_params 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
- symforce.databuffer module
DataBuffer
default_assumptions
is_algebraic
is_commutative
is_complex
is_composite
is_even
is_extended_negative
is_extended_nonnegative
is_extended_nonpositive
is_extended_nonzero
is_extended_positive
is_extended_real
is_imaginary
is_integer
is_irrational
is_negative
is_noninteger
is_nonnegative
is_nonpositive
is_nonzero
is_odd
is_positive
is_prime
is_rational
is_real
is_transcendental
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()
dots_and_brackets_to_underscores()
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
args
args_as_sage()
args_as_sympy()
as_coefficients_dict()
as_numer_denom()
as_real_imag()
atoms()
coeff()
copy()
diff()
evalf()
expand()
free_symbols
has()
is_Add
is_AlgebraicNumber
is_Atom
is_Boolean
is_DataBufferElement
is_Derivative
is_Dummy
is_Equality
is_Float
is_Function
is_Integer
is_Matrix
is_Mul
is_Not
is_Number
is_Pow
is_Rational
is_Relational
is_Symbol
is_finite
is_integer
is_negative
is_nonnegative
is_nonpositive
is_number
is_positive
is_real
is_symbol
is_zero
msubs()
n()
replace()
simplify()
subs()
subs_dict()
subs_oldnew()
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
create_named_scope()
set_scope()
get_scope()
scope()
Symbol
symbols()
epsilon()
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()
integrate()
solve()
count_ops()
DataBuffer
original_get_dict()
Complex
DualQuaternion
Storage
Matrix
MatrixT
SHAPE
__new__()
rows
cols
shape
is_Matrix
storage_dim()
from_storage()
to_storage()
tangent_dim()
from_tangent()
to_tangent()
storage_D_tangent()
tangent_D_storage()
zero()
zeros()
one()
ones()
diag()
eye()
det()
inv()
symbolic()
row_join()
col_join()
block_matrix()
simplify()
limit()
jacobian()
diff()
T
transpose()
lower_triangle()
Triangle
symmetric_copy()
reshape()
dot()
cross()
squared_norm()
norm()
normalized()
clamp_norm()
multiply_elementwise()
applyfunc()
__getitem__()
row()
col()
__neg__()
__add__()
__sub__()
__mul__()
__rmul__()
__div__()
compute_AtA()
LU()
LDL()
FFLU()
FFLDU()
solve()
__truediv__()
are_parallel()
skew_symmetric()
evalf()
to_list()
to_flat_list()
from_flat_list()
to_numpy()
column_stack()
is_vector()
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
Pose3
Quaternion
Rot2
Rot3
storage_dim()
to_storage()
from_storage()
symbolic()
identity()
compose()
inverse()
tangent_dim()
from_tangent()
to_tangent()
hat()
storage_D_tangent()
tangent_D_storage()
__mul__()
to_tangent_norm()
to_rotation_matrix()
from_rotation_matrix()
to_yaw_pitch_roll()
from_yaw_pitch_roll()
from_angle_axis()
from_two_unit_vectors()
angle_between()
random()
random_from_uniform_samples()
Unit3
ATANCameraCal
Camera
CameraCal
DoubleSphereCameraCal
EquirectangularCameraCal
LinearCameraCal
PolynomialCameraCal
PosedCamera
SphericalCameraCal
- symforce.type_helpers module
- symforce.typing module
- symforce.typing_util module
- symforce.util module