-
Notifications
You must be signed in to change notification settings - Fork 32
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
Issue? Current implementation gives EcoIndex between -5 and 94 instead of 0 to 99 #61
Comments
Yes you are right , following a pull request , i worked on a correction regarding this topic a year ago and never merged it : 350ca5a I will have a look |
Thanks Olivier (and Rachel) for this point. IT's obvious we should implent this patch asap. The good news is that this will have a negligeable side effect to already computed EcoIndex evaluation. |
The patch is integrated in release 3.1.0 available on chrome web store and firefox add ons |
Merci !
Le sam., sept. 10, 2022 à 18:04, ***@***.***> a écrit:
The patch is integrated in release 3.1.0 available on chrome web store and firefox add ons
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi,
I suspect there is an issue (or an inconsistency against the Ecoindex specification) in the current EcoIndex implementation located in the file
ecoIndex.js
.As it is currently computed, EcoIndex value is between -5 and 94 rather than between 0 and 99 :
<html></html>
containing 3 DOM objects (page + empty header + empty body), generating 1 HTTP request and being 13-byte long) gets an EcoIndex equal to 94.00 (if rounded to 2 digits after the decimal point).Rachel Pellin's EcoIndex simulator (https://rachelwe.github.io/Simulateur-ecoindex/), which uses
ecoIndex.js
current implementation, helps highligting this behaviour:In my opinion, the issue lies in the
calculateIndex
function, which should return:return ((i - 1) + (value - quantiles[i - 1]) / (quantiles[i] - quantiles[i - 1]));
and
return quantiles.length - 1;
instead of:
return (i + (value - quantiles[i - 1]) / (quantiles[i] - quantiles[i - 1]));
and
return quantiles.length;
If such a change were to be made, the grade computation would obviously have to be also altered, by adding 5 to every threshold:
case score >= 80: return 'A';
// instead of 75case score >= 70: return 'B';
// instead of 65...
case score >= 10: return 'F';
// instead of 5Best Regards,
Olivier Descout
The text was updated successfully, but these errors were encountered: