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

better method for handling patches where taxon no longer exists #368

Open
kcranston opened this issue Sep 13, 2019 · 1 comment
Open

better method for handling patches where taxon no longer exists #368

kcranston opened this issue Sep 13, 2019 · 1 comment

Comments

@kcranston
Copy link
Member

kcranston commented Sep 13, 2019

When applying the patches in curation/amendments.py, the whole build fails if the target taxon does not exist. The current fix seems to be adding a call to maybeTaxon before the patch, e.g. changing:

ott.taxon('Reptilia').hide()

to

if ott.maybeTaxon('Reptilia') != None:
        ott.taxon('Reptilia').hide()

this means you have to wait for the build to fail to see which ones need to be changed. Would be better to have methods that checked for existence of the Taxon and simply printed a message to the logs if the patch could not be applied. (Also, the current construct leaves no trace of patches that were not applied because the taxon in question does not exist).

@jar398
Copy link
Member

jar398 commented Oct 15, 2019

this would be better done as an extension to the 'new' patch system
https://github.com/OpenTreeOfLife/reference-taxonomy/blob/master/util/proposition.py
for which name non-resolution is not catastrophic.

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