symforce.notebook_util module#

Helpers for interactive use in a Jupyter notebook with an IPython kernel.

display(*args)[source]#

Display the given expressions in latex, or print if not an expression.

Parameters:

args (Any) –

Return type:

None

display_code(code, language=None)[source]#

Display code with syntax highlighting.

Parameters:
  • code (str) – Source code

  • language (str | None) – {python, c++, anything supported by pygments}

Return type:

None

display_code_file(path, language)[source]#

Display code from a file path with syntax highlighting.

Parameters:
  • path (str | PathLike) – Path to source file

  • language (str) – {python, c++, anything supported by pygments}

Return type:

None

print_expression_tree(expr, assumptions=False)[source]#

Print a SymPy expression tree, ignoring node attributes

Parameters:
  • expr (Expr) – The expression to print

  • assumptions (bool) – Whether to include assumption information for nodes. See sympy.printing.tree for more information.

Return type:

None