Skip to content

Rename tree.length attribute to tree.span? #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hyanwong opened this issue Dec 19, 2018 · 3 comments
Closed

Rename tree.length attribute to tree.span? #29

hyanwong opened this issue Dec 19, 2018 · 3 comments

Comments

@hyanwong
Copy link
Member

At the moment the msprime/tskit API defines SparseTree.length to be the genomic length covered by a tree. It can be quite confusing when branches on a tree can have "lengths" too. I’ve been trying to use the word "span" instead of "length" to refer to the genome span covered by an edge or a tree. Would it be sensible to add the attribute .span as a preferred alternative to .length on a SparseTree (and perhaps change the description in other places in the documentation where we refer to extent over a genomic region, such as the "span" (i.e. length) of an edge).

@jeromekelleher
Copy link
Member

I like this --- having "length" refer to two different things is confusing. However, we still have the sequence_length attribute of the tree sequence itself, which we can't rename without a great deal of pain. Having span for tree seems like a good idea to me though.

@petrelharp
Copy link
Contributor

Yes, good call. So, would SparseTree.length be deprecated?

@jeromekelleher
Copy link
Member

Yeah, I think so. I'd imagine keeping it around for a long time though, no point in breaking people's code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants