-
Notifications
You must be signed in to change notification settings - Fork 86
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
sim_ancestry docs/defaults for "ploidy" are confusing #1717
Comments
We have this pattern a lot throughout msprime/tskit. The default is set to As an example, the I agree this is less than ideal when it comes to docs and tooling though. |
Then I'd say that it is the docs that are wrong here: the default is None, not 2, and the behavior is to use 2 if the default is passed through. |
Yes the docstring could be clearer here, some thing like "if no ploidy is specified 2 is used" rather than "(Default=2)" |
Yes, that would be better. Personally, I see this as violating the Python mantra of explicit being better than implicit. |
I see where you're coming from here @molpopgen, but this is a hard-learned lesson for me. Unless you're certain a function is never going to get any more parameters or has really simple semantics, it's a mistake to embed the default in the signature. Certainly neither of these is true for sim_ancestry. |
Shall we clarify the doc string a bit then? |
Sure, I've added it to the next point release. |
The docs for
msprime.sim_ancestry
say that ploidy defaults to 2, yet the function defaults toNone
.It would be preferable if the function default were acutally 2, especially for people using language servers, iPython/Jupyter.
It seems that this is the line to change:
The text was updated successfully, but these errors were encountered: