abracudabra.testing#

Assertions for testing purposes.

These functions are used in the unitary tests. The equality checks assume no floating-point errors.

Functions#

assert_tensors_equal(tensor1, tensor2, /)

Assert that two Torch tensors are equal.

assert_arrays_equal(array1, array2, /)

Assert that two arrays are equal.

assert_frames_equal(frame1, frame2)

Assert that two Pandas/cuDF series or dataframes are equal.

Module Contents#

abracudabra.testing.assert_tensors_equal(tensor1, tensor2, /)[source]#

Assert that two Torch tensors are equal.

Parameters:
  • tensor1 (torch.Tensor)

  • tensor2 (torch.Tensor)

Return type:

None

abracudabra.testing.assert_arrays_equal(array1, array2, /)[source]#

Assert that two arrays are equal.

Parameters:
  • array1 (abracudabra._annotations.Array)

  • array2 (abracudabra._annotations.Array)

Return type:

None

abracudabra.testing.assert_frames_equal(frame1, frame2)[source]#

Assert that two Pandas/cuDF series or dataframes are equal.

Parameters:
  • frame1 (abracudabra._annotations.Series | abracudabra._annotations.DataFrame)

  • frame2 (abracudabra._annotations.Series | abracudabra._annotations.DataFrame)

Return type:

None