-
Notifications
You must be signed in to change notification settings - Fork 74
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
Deprecate Tree.num_nodes? #1966
Comments
That is confusing, I agree. Happy to mark it as deprecated/undocument it, etc. |
My vote would be to deliberately mark it for deprecation, rather than simply undocument it, because there's a good chance that it's actually an error if it's being used. |
OK. I don't think we have a formal deprecation process yet. Let's use the sphinx directive for now, "deprecated since 0.4.0" |
Cool. I was going to issue a |
Might be worth using https://deprecation.readthedocs.io/en/latest/ to check we are emiting the right kind of warning. |
Raising a FutureWarning when accessing it may also be handy?? |
FutureWarning is a great idea, thanks @molpopgen - I've just incorporated it. |
Great. This is one of python's great gotchas. DeprecationWarning seems like what you want, but it is suppressed by default because it is only for developers. |
Wrongly tagged by me as fixed by 64cb77d |
Even though it's documented, I think it's super confusing that
Tree.num_nodes
returns the number of nodes in the entire tree sequence, not the number of nodes in the tree itself. I suggest we might want to deprecate it and say that the user should useTree.tree_sequence.num_nodes
instead, which is much clearer.The text was updated successfully, but these errors were encountered: