Cadabra
a field-theory motivated approach to computer algebra

cdb.utils.develop

Helper functions to aid development, debugging and testing
This package contains some standardised functionality to aid in development of library code and Python algorithms
import inspect

time_algo(algo: function, ex: Ex, *args: <mixed>, iterations: int = 100) -> float

Simple function to time the execution of an algorithm with given inputs.
The arguments in *args are passed directly, but ex is copied before each invocation and so remains unmodified.

CadabraTestError

Exception derived from AssertionError raised by testing functions when an assertion fails
class CadabraTestError(AssertionError): pass

test_algo(expected: Ex, verbose: bool)

Decorator to aid defining unit tests for algorithms.
This adds the boilerplate code and adds an assert for the test.

inherit_kernel() -> Kernel

Find a kernel in the stack.
Move up stack frames until one which defines the __cdbkernel__ variable is located and return it. If no Kernel object is foundthen None is returned
Copyright © 2001-2021 Kasper Peeters
Questions? info@cadabra.science