tskit-dev / pyslim

Tools for dealing with tree sequences coming to and from SLiM.
MIT License
27 stars 23 forks source link

individual_parents() not accepting array of individual ID's #196

Closed pam-alamilla closed 3 years ago

pam-alamilla commented 3 years ago

When an array of individual ID’s is passed to the individual_parents() command, the following error appears:

TypeError: individual_parents() takes 1 positional argument but 2 were given

In response, I have attempted to pass NumPy arrays and lists to no avail. However, when the command is used in the default state (all individuals), it works fine.

Is this an issue with the command itself? The documentation states that it should accept ‘The IDs of individuals that parents should be found for’ as a parameter: https://pyslim.readthedocs.io/en/latest/python_api.html?highlight=individual_parents#pyslim.SlimTreeSequence.individual_parents

petrelharp commented 3 years ago

Hm, interesting - could you post the code that you're running, and the output?

petrelharp commented 3 years ago

Oh, wait, sorry - you don't need to post the code. individual_parents() does not take any arguments - doing ts.individual_parents() gives you all the parent-child relationships as far as we can tell; there is no option for getting only some of them. And, you're right, it's an issue with the documentation; thanks!!

petrelharp commented 3 years ago

It would be nice to provide that argument - I must have thought I would implement it, but didn't.

pam-alamilla commented 3 years ago

Ah I see, thank you Peter for your quick response. Cheers!