MAINT: move some testing code into a separate function for computing contributions to the differential entropy