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

AskTPL class only handles rank species #150

Open
mfrasca opened this issue Aug 1, 2016 · 6 comments
Open

AskTPL class only handles rank species #150

mfrasca opened this issue Aug 1, 2016 · 6 comments
Labels
ux ux bug

Comments

@mfrasca
Copy link
Member

mfrasca commented Aug 1, 2016

reported by @fruit-github: (#147)

I have had an issue adding a species more recently that I think should have given a result from the green button. Adding Gymnocalycium damsii, reponse is..
No match found on ThePlantList.org
yet searching ThePlantList.org gives http://www.theplantlist.org/tpl1.1/search?q=Gymnocalycium+damsii

this seems caused by the fact that tpl does not contain a taxon that is used as accepted name for the given query.

quick solution to this case:

@@ -105,7 +105,15 @@ class AskTPL(threading.Thread):
             else:
                 raise NoResult
             if found['Accepted ID']:
-                accepted = ask_tpl(found['Accepted ID'])[0]
+                logger.debug("found this: %s", str(found))
+                accepted = ask_tpl(found['Accepted ID'])
+                logger.debug("ask_tpl on the Accepted ID returns %s", accepted)
+                if accepted:
+                    accepted = accepted[0]
+                else:
+                    logger.warning("taxon is marked as synonym, but can't "
+                                   "access accepted form %s", found['Accepted ID'])
+                    accepted = None
                 logger.debug("%s after second query", self.name)
             if self.stopped():
                 raise ShouldStopNow('after second query')
@mfrasca
Copy link
Member Author

mfrasca commented Aug 1, 2016

looks like I made an incorrect statement.
the referred to taxon is in TPL but it is at rank subspecies, and my ask_tpl method filters away anything that is at rank lower than species, so it does not find it.
Gymnocalycium damsii (K.Schum.) Britton & Rose is a synonym of Gymnocalycium anisitsii subsp. damsii (K.Schum.) G.J.Charles

to correct the behaviour of ghini, we need adding the handling of infraspecific taxonomic information.

@mfrasca mfrasca changed the title the plant list does not contain referred to taxon AskTPL class only handles rank species Aug 1, 2016
@mfrasca
Copy link
Member Author

mfrasca commented Aug 1, 2016

a quick and incomplete correction:

when you click on the sp_species_button button, ghini start the lookup (check #151).

as soon as the lookup ends (or times out), ghini removes all previous message boxes and shows the results.
result can be:

  • no result
  • this is the closest match

and can be followed by:

  • closest match is a synonym of this other species
  • closest match is a synonym of something at infraspecific rank, which I cannot handle.

@mfrasca
Copy link
Member Author

mfrasca commented Aug 1, 2016

screenshot from 2016-08-01 11 14 54

mfrasca pushed a commit that referenced this issue Aug 1, 2016
@mfrasca mfrasca added the ux ux bug label Aug 1, 2016
mfrasca pushed a commit that referenced this issue Aug 1, 2016
@fruit-github
Copy link

That looks a great improvement to me, thanks

I guess from your 'but I'm afraid this should go to 1.0-dev' that this is not available from a '-u' update - and that itself is not a problem as I see it

@mfrasca
Copy link
Member Author

mfrasca commented Aug 2, 2016

indeed, not yet published on the ghini-1.0 branch, you either wait until I do so, it will be 1.0.60, or you explicitly move to the ghini-1.0-dev branch.

@fruit-github
Copy link

Happy to wait thanks

@mfrasca mfrasca removed the ghini-3.2 label Mar 28, 2018
@mfrasca mfrasca added this to the Tanager-2018-08 milestone Aug 20, 2018
@mfrasca mfrasca removed this from the Tanager-2018-08 milestone Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux ux bug
Projects
None yet
Development

No branches or pull requests

2 participants