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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions OZprivate/rawJS/OZTreeModule/src/factory/midnode.js
Expand Up @@ -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.

if (this.detail_fetched) {
this._threatened_branch = (num_threatened > this.richness_val * 0.5);
this._threatened_branch = (num_threatened > num_extant * 0.5);
}
return num_threatened > this.richness_val * 0.5;
return num_threatened > num_extant * 0.5;
}
get redlist() {
if (this._redlist !== null) return this._redlist;
Expand Down