tacco.testing.string_encode

string_encode(data)[source]

Helper function to freeze complex result objects to support regression testing. The function freezes objects to a compressed string representation which can be included in the test source code.

WARNING: The functionality is based on pickle and therefore the thawing becomes impossible if the object implementation changes, e.g. by incompatible version upgrades of packages, like Anndata.

Parameters:

data – The object to freeze.

Returns:

Returns a compressed string representation of the object to freeze.