Closed Daniel-Davies closed 4 years ago
Merging #51 into master will decrease coverage by
0.20%
. The diff coverage is33.33%
.
@@ Coverage Diff @@
## master #51 +/- ##
==========================================
- Coverage 38.86% 38.66% -0.21%
==========================================
Files 20 22 +2
Lines 795 825 +30
==========================================
+ Hits 309 319 +10
- Misses 486 506 +20
Impacted Files | Coverage Δ | |
---|---|---|
pytaxize/gbif/suggest.py | 28.57% <28.57%> (ø) |
|
pytaxize/gbif/__init__.py | 100.00% <100.00%> (ø) |
|
pytaxize/gbif/constants.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 679d61b...31425ec. Read the comment docs.
thanks @Daniel-Davies The PR looks great - and thanks for being detailed and following contributing notes. First take away I think is probably open an issue first to discuss (and then PR) while you get oriented here and I explain things that should be documented (my fault, sorry)
In general I am very keen to get any contributions here as I don't have much time to maintain python packages as they're outside of my main work focus.
However, I think for GBIF data for pytaxize, since pygbif https://github.com/sckott/pygbif is pretty solid now we should import that as needed and not replicate its functionality here.
in the pytaxize gbif module:
parse
: already in pygbif https://pygbif.readthedocs.io/en/latest/modules/species.html#pygbif.species.name_parser - and anyway the pytaxize version is using an old base url, so good to get rid of thatgbif_name_backbone
and gbif_name_lookup
: aren't used anywhere yet - should drop these and import equivalents from pygbif when/as needed - https://pygbif.readthedocs.io/en/latest/modules/species.htmlsuggest
- the method in this PR - in pygbif already https://pygbif.readthedocs.io/en/latest/modules/species.html#pygbif.species.name_suggest The high level view I have of this package:
Ids
here will work with many different data sources as allowed by those data sources. e.g., in R pkg taxize downstream or children. The Ids
class here is equivalent to the get*()
taxize functions, where instead of separate functions in the R pkg, I thought we'd have a class here (Ids
) and then you can call methods on that class for each data source. So one thing would be great to have if you're keen is a gbif method within Ids
I realize that I did duplicate effort/code in R taxize where I have gbif code instead of using the R rgbif client, but I want to not do that here when possible.
note: actively working on children and classification classes - so make sure to update your branch before from the main branch as needed
…ered parse wrapper. Also added corresponding unit tests
Description
This will be my first of (hopefully many) additions to pytaxize. For my initial test commit, I have added a very basic wrapper over the GBIF suggestion API (see https://www.gbif.org/developer/species => /species/suggest), that is similar in style to the already existing "parse.py". I have also added the corresponding unit tests. Code was run through "black", as requested in the contributions guide.
The GBIF wrapper itself takes a partially completed, or malformed name, and outputs an "autocompletion" of up to 20 possible taxa for the input name.
Should this be merged, I will follow up with an addition of GBIF to the docs.
Related Issue
Example
from pytaxize import gbif response = gbif.suggest( name='puma con', as_dataframe=False ) => [{'scientificName':'puma concolor'},{...}]