tskit
tskit copied to clipboard
Add `individuals=` argument to everything.
Reasoning: #2047. See also #464.
Presumably we also want a get_individuals_associated with_sample_nodes()
function.
It'd be helpful to list out the functions that we want here. Anyone fancy going through the API and see where it makes sense to add individuals
? (I suppose a first pass would be "everywhere we use samples"?)
We also want to think about whether we update things like sample_sets
in the stats methods to accept individuals, and how we might go about doing that.
See also #1697
Does it make sense to deprecate arguments named "samples" and replace them with "sample_nodes" and "sample_individuals"?
It does, but I hate to churn everyone's code like that...
It does, but I hate to churn everyone's code like that...
We can raise FutureWarning when samples is used for a release or 2, then remove it. I think that'd be plenty of lead time. I think it's best to get the clean interface that we want.
Does it make sense to deprecate arguments named "samples" and replace them with "sample_nodes" and "sample_individuals"?
I don't know if I'm such a fan of this - I don't mind deprecating obscure features that we're pretty sure no one uses, but this is core functionality. Personally I like be able to run old code without having to make a special env...
In a lot of cases I think it's probably fine to change the current signature from
def simplify(self, samples=None, *, ...)
with
def simplify(self, sample_nodes=None, *, samples=None, ...)
and do the standard "samples is an alias for sample_nodes" thing. Then we're not going to break any code. It's not such a big deal to carry around a few parameter aliases (there's quite a few of them around already).