Closed
Description
It should be impossible to calculate the diversity of a single sample, because we need to pick at least one pair of distinct samples to calculate it. So this is expected:
ts = msprime.sim_ancestry(10, ploidy=1)
ts = msprime.sim_mutations(ts, rate=0.1)
print(ts.diversity([0], mode="branch")) # prints "array(nan)"
But looks what happens if there's only one sample in the ts:
ts = msprime.sim_ancestry(1, ploidy=1)
ts = msprime.sim_mutations(ts, rate=0.1)
print(ts.diversity([0], mode="branch")) # prints "array(0.)" <- er, what?