pints icon indicating copy to clipboard operation
pints copied to clipboard

Make PINTS sampler objects printable using __str__

Open ben18785 opened this issue 4 years ago • 0 comments

I think it'd be nice if:

x0 = [3, 4]
sampler = pints.HamiltonianMCMC(x0)
print(sampler)

returned:

"Hamiltonian Monte Carlo sampler initialised at [3, 4]"

If x0 was long, then we could just print the first (say) 10 elements:

"Hamiltonian Monte Carlo sampler initialised at [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,...]"

Some samplers also take sigma0 values but I don't think we should print these since a) I think we're thinking of moving these to be method hyperparameters and b) it'd look ugly.

ben18785 avatar Feb 12 '21 00:02 ben18785