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

Fixed threatened_branch() to exclude extinct species. #707

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wolfmanstout
Copy link
Contributor

With the way that threatened_branch() was being calculated, a branch consisting entirely of threatened and extinct species could get marked as not threatened. This excludes extinct species from the calculation.

@@ -412,10 +412,11 @@ class Midnode {
num_threatened += this.get_attribute("iucnEN");
num_threatened += this.get_attribute("iucnCR");
}
let num_extant = this.richness_val - (this.get_attribute("iucnEX") + this.get_attribute("iucnEW"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add these to num_threatened as with the other values, rather than subtracting from richness_val? I don't think that num_extant does what you want:

    num_threatened > num_extant * 0.5
==> iucnVU + iucnEN + iucnCR > richness * 0.5 - (iucnEX + iucnEW) * 0.5
==> iucnVU + iucnEN + iucnCR + (iucnEX + iucnEW) * 0.5 > richness * 0.5
==> iucnVU + iucnEN + iucnCR + iucnEX * 0.5 + iucnEW * 0.5 > richness * 0.5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going with the definition here under Categories:

https://en.m.wikipedia.org/wiki/IUCN_Red_List

I read your expansion but I think it does what we want. It's confusing to expand because the extinct categories are actually adding to richness already, so this removes them from the calculation.

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

Successfully merging this pull request may close these issues.

None yet

2 participants