-
Notifications
You must be signed in to change notification settings - Fork 79
Raise error if pop passed to samples is not an integer #3344
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
Conversation
aeede92 to
60a85a8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3344 +/- ##
=======================================
Coverage 89.76% 89.76%
=======================================
Files 29 29
Lines 31289 31292 +3
Branches 5737 5738 +1
=======================================
+ Hits 28086 28089 +3
Misses 1794 1794
Partials 1409 1409
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jeromekelleher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs much more testing - just testing for one example when doing this type of type handling really isn't enough.
a9f564a to
969032d
Compare
c7e8a79 to
9ca7724
Compare
Co-authored-by: Peter Ralph <petrel.harp@gmail.com>
9ca7724 to
15fd849
Compare
|
Changes made and squashed. We still don't have a good newbie solution for "get all the samples in the population named 'AFR'" though. At the moment I guess we recommend making a map, but that's not very beginner friendly: name_to_id = {pop.metadata["name"]: pop.id for pop in ts.populations()}
ts.samples(name_to_id["AFR"])See #1697 where I suggest |
|
I'm waiting for this to merge so I can rebase #3345 . What's the etiquette here: if there is one approval, can the OP (me) click the merge button, or should I get someone else to do it? Do we require two approvals (I think not?) |
Description
This has bugged me for ages: you can do
ts.samples(population="AFR")without raising an error, although thepopulationparam is required to be an integer (so that snippet will always return an empty array)I thought using
intwas the simplest way to check, as it avoidsisinstance(population, string)or equivalent, and will deal with arrays etc, but it does allowts.samples(population="0"), which maybe we don't want?PR Checklist: