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
symengineAPI if it is available. If the symbolic API is set tosympyit will use that. Ifsymengineis not available and the symbolic API was not set, it will emit a warning and use thesympyAPI.The symbolic API can be set by one of:
The
SYMFORCE_SYMBOLIC_APIenvironment 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:
ExceptionException thrown on attempting to modify the default epsilon after it has been used elsewhere
- class SymbolicEpsilon(name)[source]¶
Bases:
objectAn 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.symbolicor 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.symbolicor 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.symbolicor 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
TypeErrornear the location where you forgot to pass an epsilon.This must be called before
symforce.symbolicor 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.orthographic_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
DenseAndSparseOutputTermsOutputWithTermsPrintCodeResultCSCFormatprint_code()perform_cse()format_symbols()get_formatted_list()get_formatted_sparse_list()load_generated_package()load_generated_function()load_generated_lcmtype()get_base_instance()LcmBindingsDirsgenerate_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
MatrixMatrix11Matrix21Matrix31Matrix41Matrix51Matrix61Matrix71Matrix81Matrix91Matrix12Matrix22Matrix32Matrix42Matrix52Matrix62Matrix72Matrix82Matrix92Matrix13Matrix23Matrix33Matrix43Matrix53Matrix63Matrix73Matrix83Matrix93Matrix14Matrix24Matrix34Matrix44Matrix54Matrix64Matrix74Matrix84Matrix94Matrix15Matrix25Matrix35Matrix45Matrix55Matrix65Matrix75Matrix85Matrix95Matrix16Matrix26Matrix36Matrix46Matrix56Matrix66Matrix76Matrix86Matrix96Matrix17Matrix27Matrix37Matrix47Matrix57Matrix67Matrix77Matrix87Matrix97Matrix18Matrix28Matrix38Matrix48Matrix58Matrix68Matrix78Matrix88Matrix98Matrix19Matrix29Matrix39Matrix49Matrix59Matrix69Matrix79Matrix89Matrix99mmatrix_type_from_shape()MVector1Vector2Vector3Vector4Vector5Vector6Vector7Vector8Vector9V1V2V3V4V5V6V7V8V9M11M21M31M41M51M61M71M81M91M12M22M32M42M52M62M72M82M92M13M23M33M43M53M63M73M83M93M14M24M34M44M54M64M74M84M94M15M25M35M45M55M65M75M85M95M16M26M36M46M56M66M76M86M96M17M27M37M47M57M67M77M87M97M18M28M38M48M58M68M78M88M98M19M29M39M49M59M69M79M89M99I1()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.stubs_util 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
DataBufferdefault_assumptionsis_algebraicis_commutativeis_complexis_compositeis_evenis_extended_negativeis_extended_nonnegativeis_extended_nonpositiveis_extended_nonzerois_extended_positiveis_extended_realis_imaginaryis_integeris_irrationalis_negativeis_nonintegeris_nonnegativeis_nonpositiveis_nonzerois_oddis_positiveis_primeis_rationalis_realis_transcendentalis_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()InvalidKeyErrorInvalidPythonIdentifierErrorbase_and_indices()plural()get_func_from_maybe_bound_function()get_class_for_method()AttrDictfind_ruff_bin()find_uv_bin()
- symforce.symbolic module
AbsAddBasicargsargs_as_sage()args_as_sympy()as_coefficients_dict()as_numer_denom()as_real_imag()atoms()coeff()copy()diff()evalf()expand()free_symbolshas()is_Addis_AlgebraicNumberis_Atomis_Booleanis_DataBufferElementis_Derivativeis_Dummyis_Equalityis_Floatis_Functionis_Integeris_Matrixis_Mulis_Notis_Numberis_Powis_Rationalis_Relationalis_Symbolis_finiteis_integeris_negativeis_nonnegativeis_nonpositiveis_numberis_positiveis_realis_symbolis_zeromsubs()n()replace()simplify()subs()subs_dict()subs_oldnew()xreplace()
ContainsDerivativeDummyExprFiniteSetFloatFunctionIntegerIntervalKroneckerDeltaLambertWLeviCivitaMaxMinMod()MulNumberPiecewisePowRationalRealNumberSubsSympifyErrorUnevaluatedExpracosacoshacotacothacscacschasecasechasinasinhatanatanhbetaceilingconjugatecoscoshcotcothcsccschcse()diff()digamma()dirichlet_etaerferfcexp()expand()floorgamma()init_printing()integer_nthroot()isprime()lambdify()latex()linsolve()logloggammalowergammaperfect_power()polygammasecsechseries()signsinsinhsqrt()sqrt_mod()sympify()tantanhtrigamma()uppergammavar()zetacreate_named_scope()set_scope()get_scope()scope()Symbolsymbols()epsilon()Scalaris_positive()is_negative()is_nonnegative()is_nonpositive()less_equal()greater_equal()less()greater()logical_and()logical_or()logical_not()wrap_angle()angle_diff()argmax_onehot()argmax()atan2()asin_safe()acos_safe()clamp()set_eval_on_sympify()SymPySignNoZeroSymPyCopysignNoZeroCopysignNoZeroSignNoZerosign_no_zero()copysign_no_zero()simplify()limit()integrate()solve()count_ops()DataBufferoriginal_get_dict()LieGroupComplexDualQuaternionStorageMatrixMatrixTSHAPE__new__()rowscolsshapeis_Matrixstorage_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()Ttranspose()lower_triangle()Trianglesymmetric_copy()reshape()dot()cross()squared_norm()norm()normalized()clamp_norm()multiply_elementwise()applyfunc()__getitem__()row()col()__neg__()__add__()__sub__()__mul__()__rmul__()__truediv__()compute_AtA()LU()LDL()FFLU()FFLDU()solve()are_parallel()skew_symmetric()evalf()to_list()to_flat_list()from_flat_list()to_numpy()column_stack()is_vector()init_printing()
Matrix11Matrix21Matrix31Matrix41Matrix51Matrix61Matrix71Matrix81Matrix91Matrix12Matrix22Matrix32Matrix42Matrix52Matrix62Matrix72Matrix82Matrix92Matrix13Matrix23Matrix33Matrix43Matrix53Matrix63Matrix73Matrix83Matrix93Matrix14Matrix24Matrix34Matrix44Matrix54Matrix64Matrix74Matrix84Matrix94Matrix15Matrix25Matrix35Matrix45Matrix55Matrix65Matrix75Matrix85Matrix95Matrix16Matrix26Matrix36Matrix46Matrix56Matrix66Matrix76Matrix86Matrix96Matrix17Matrix27Matrix37Matrix47Matrix57Matrix67Matrix77Matrix87Matrix97Matrix18Matrix28Matrix38Matrix48Matrix58Matrix68Matrix78Matrix88Matrix98Matrix19Matrix29Matrix39Matrix49Matrix59Matrix69Matrix79Matrix89Matrix99mmatrix_type_from_shape()MVector1Vector2Vector3Vector4Vector5Vector6Vector7Vector8Vector9V1V2V3V4V5V6V7V8V9M11M21M31M41M51M61M71M81M91M12M22M32M42M52M62M72M82M92M13M23M33M43M53M63M73M83M93M14M24M34M44M54M64M74M84M94M15M25M35M45M55M65M75M85M95M16M26M36M46M56M66M76M86M96M17M27M37M47M57M67M77M87M97M18M28M38M48M58M68M78M88M98M19M29M39M49M59M69M79M89M99I1()I11()I2()I22()I3()I33()I4()I44()I5()I55()I6()I66()I7()I77()I8()I88()I9()I99()VectorClassLieGroupOpsPose2Pose3QuaternionRot2Rot3storage_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()
Unit3E_XE_ZFLIP_Ystorage_dim()to_storage()from_storage()symbolic()identity()compose()inverse()tangent_dim()from_tangent()to_tangent()storage_D_tangent()tangent_D_storage()retract()local_coordinates()to_unit_vector()basis()from_vector()from_unit_vector()random()random_from_uniform_samples()
ATANCameraCalCameraCameraCalDoubleSphereCameraCalEquirectangularCameraCalLinearCameraCalOrthographicCameraCalPolynomialCameraCalPosedCameraSphericalCameraCal
- symforce.type_helpers module
- symforce.typing module
- symforce.typing_util module
- symforce.util module