Skip to content
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

Is the families filter working? #4

Open
jts1882 opened this issue Sep 25, 2021 · 1 comment
Open

Is the families filter working? #4

jts1882 opened this issue Sep 25, 2021 · 1 comment

Comments

@jts1882
Copy link

jts1882 commented Sep 25, 2021

The following code selects all accepted genera in family Rutaceae:

import pykew.powo as powo
from pykew.powo_terms import Name, Filters

query = { Name.family: 'Rutaceae' }                 
myfilters = [Filters.accepted, Filters.genera]      

result = powo.search(query, filters = myfilters)
print(result.size())
for r in result :
   if 'name' in r and 'author' in r : print(r['name']+" "+r['author'])

Similarly, the species in each genus can be got by changing the query and filters, e.g. for Citrus:

query = { Name.genus: 'Citrus' }                 
myfilters = [Filters.accepted, Filters.species]   

However, the following fails to get a list of families using the same approach:

query = { Name.kingdom: 'Plantae' }                 
myfilters = [Filters.accepted, Filters.families]     

It returns 402,409 results. The "families" filter doesn't seem to work as the same number of results are obtained when just using the "accepted" filter. I tried the "families" filter in some other tests and it didn't seem to do anything.

So two questions, does the "family" filter work? And if not, is there another way of getting a list of families?

@malcolm-s
Copy link

Hi there!

This package is not actively maintained, but from looking at the API you should be able to just pass the string family_f rather than Filters.families (which points to families_f).

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

2 participants