tskit icon indicating copy to clipboard operation
tskit copied to clipboard

add `mask` option to stats

Open petrelharp opened this issue 6 years ago • 4 comments
trafficstars

This is going to be necessary for stdpopsim. We can do it easily in python at first as I did here.

petrelharp avatar Aug 27 '19 16:08 petrelharp

Agreed. As discussed somewhere in #261, I think the mask argument should be a 2D numpy array with shape (N, 2) so that we would mask out two regions with something like

ts.diversity(mask=[(s1, e1), (s2, e2)])

We can use the recently added interval operations in util.py to parse these mask arguments.

jeromekelleher avatar Aug 27 '19 17:08 jeromekelleher

As discussed, we're not sure when these are needed though. I'm provisionally adding them to a new 0.2.3 milestone, but we can promote to 0.2.2 if we want.

jeromekelleher avatar Aug 27 '19 17:08 jeromekelleher

Is this feature still desired?

szhan avatar Jun 28 '22 08:06 szhan

Yes - but it's a can of worms. I wouldn't take it on unless you have a spare month!

jeromekelleher avatar Jun 28 '22 09:06 jeromekelleher