Skip to content

Commit

Permalink
Update freshwater ecotoxicity normalization, March 2024.
Browse files Browse the repository at this point in the history
  • Loading branch information
n1k0 committed Mar 5, 2024
1 parent 2a69c9c commit e4e7024
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion public/data/impacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
"pef": null,
"ecoscore": {
"color": "#375622",
"normalization": 1.04926e5,
"normalization": 9.812e4,
"weighting": 0.2106
},
"correction": [
Expand Down
10 changes: 5 additions & 5 deletions tests/Data/Food/RecipeTest.elm
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ suite =
Expect.fail err

Ok result ->
expectImpactEqual (Unit.impact 130.6907377629544) result
expectImpactEqual (Unit.impact 132.7673447565242) result
)
, asTest "should have the ingredients' total ecs impact with the complement taken into account"
(case royalPizzaResults |> Result.map (Tuple.second >> .recipe >> .ingredientsTotal >> Impact.getImpact Definition.Ecs) of
Err err ->
Expect.fail err

Ok result ->
expectImpactEqual (Unit.impact 105.55650971246057) result
expectImpactEqual (Unit.impact 107.44595408642311) result
)
, describe "Scoring"
(case royalPizzaResults |> Result.map (Tuple.second >> .scoring) of
Expand All @@ -168,10 +168,10 @@ suite =

Ok scoring ->
[ Unit.impactToFloat scoring.all
|> Expect.within (Expect.Absolute 0.01) 477.94042008578447
|> Expect.within (Expect.Absolute 0.01) 484.6913141612226
|> asTest "should properly score total impact"
, Unit.impactToFloat scoring.allWithoutComplements
|> Expect.within (Expect.Absolute 0.01) 472.25827508931434
|> Expect.within (Expect.Absolute 0.01) 479.00078260079727
|> asTest "should properly score total impact without complements"
, Unit.impactToFloat scoring.complements
|> Expect.within (Expect.Absolute 0.01) -5.682144996470109
Expand All @@ -180,7 +180,7 @@ suite =
|> Expect.within (Expect.Absolute 0.0001) (Unit.impactToFloat scoring.all)
|> asTest "should expose coherent scoring"
, Unit.impactToFloat scoring.biodiversity
|> Expect.within (Expect.Absolute 0.01) 185.35640440850204
|> Expect.within (Expect.Absolute 0.01) 192.09891191998503
|> asTest "should properly score impact on biodiversity protected area"
, Unit.impactToFloat scoring.climate
|> Expect.within (Expect.Absolute 0.01) 107.33994991732318
Expand Down
30 changes: 15 additions & 15 deletions tests/e2e-food.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"swe": 0.0032694528341221415,
"tre": 0.03650533918989069,
"wtu": 0.27136489926479007,
"ecs": 129.05974742929374,
"ecs": 130.37138665804105,
"pef": 131.52243216229436
},
"scoring": {
"all": 1344.3723690551428,
"all": 1358.0352776879272,
"climate": 514.7953142562342,
"biodiversity": 396.0733882162422,
"biodiversity": 409.7362968490269,
"health": 138.50524277262488,
"resources": 294.99842381004146
}
Expand Down Expand Up @@ -56,13 +56,13 @@
"swe": 0.00043873610112264,
"tre": 0.005544701907122401,
"wtu": 0.244045006321656,
"ecs": 19.596039152088068,
"ecs": 19.931659596968984,
"pef": 18.3183804035616
},
"scoring": {
"all": 204.12540783425067,
"all": 207.6214541350936,
"climate": 46.220422793524044,
"biodiversity": 85.09885514321427,
"biodiversity": 88.59490144405717,
"health": 26.010851116595646,
"resources": 46.79527878091673
}
Expand Down Expand Up @@ -90,13 +90,13 @@
"swe": 0.001519570260434781,
"tre": 0.017356696642536692,
"wtu": 0.25570697510285245,
"ecs": 62.32890203160896,
"ecs": 63.04642804559631,
"pef": 62.39738082709091
},
"scoring": {
"all": 649.2593961625934,
"all": 656.7336254749615,
"climate": 235.61960436606554,
"biodiversity": 202.82568910073724,
"biodiversity": 210.2999184131055,
"health": 64.78076039513768,
"resources": 146.03334230065292
}
Expand Down Expand Up @@ -124,13 +124,13 @@
"swe": 0.001519570260434781,
"tre": 0.017356696642536692,
"wtu": 0.25570697510285245,
"ecs": 62.32890203160896,
"ecs": 63.04642804559631,
"pef": 62.39738082709091
},
"scoring": {
"all": 649.2593961625934,
"all": 656.7336254749615,
"climate": 235.61960436606554,
"biodiversity": 202.82568910073724,
"biodiversity": 210.2999184131055,
"health": 64.78076039513768,
"resources": 146.03334230065292
}
Expand Down Expand Up @@ -158,13 +158,13 @@
"swe": 0.00020660410361186102,
"tre": 0.0029909075471586917,
"wtu": 0.24622751656525124,
"ecs": 12.139112748926118,
"ecs": 12.407422874030674,
"pef": 10.547708546548936
},
"scoring": {
"all": 126.44909113464708,
"all": 129.24398827115286,
"climate": 19.442908649644302,
"biodiversity": 59.34478272133101,
"biodiversity": 62.13967985783679,
"health": 13.910920734869546,
"resources": 33.75047902880223
}
Expand Down

0 comments on commit e4e7024

Please sign in to comment.