From d023e926e17426dd0be41954d1851fa56170fc8e Mon Sep 17 00:00:00 2001 From: Nicolas Perriault Date: Tue, 8 Oct 2024 10:59:25 +0200 Subject: [PATCH] fix!: remove PEF scoring. --- public/data/impacts.json | 96 ---------------------------------- src/Data/Impact.elm | 2 - src/Data/Impact/Definition.elm | 24 +-------- src/Page/Explore/Impacts.elm | 20 ------- tests/Data/DefinitionTest.elm | 12 ++--- tests/Data/Food/RecipeTest.elm | 1 - tests/Data/ImpactTest.elm | 20 ++----- tests/e2e-food.json | 15 ++---- tests/e2e-textile.json | 48 ++++++----------- tests/server.spec.js | 16 +++--- 10 files changed, 40 insertions(+), 214 deletions(-) diff --git a/public/data/impacts.json b/public/data/impacts.json index 2d93fc51b..b4eb30155 100644 --- a/public/data/impacts.json +++ b/public/data/impacts.json @@ -8,19 +8,6 @@ "description_fr": "Impact *agrégé* : somme des impacts **normalisés** et **pondérés** de chaque catégorie d'impact selon la méthode Ecobalyse, incluant l'impact sur la biodiversité.\n\nCet indicateur n'a **pas de dimension**, il se mesure en **Points** (`Pt`), en **milliPoints** (`mPt`) ou en **microPoints** (`µPt`) avec `1 Pt = 1 000 mPt = 1 000 000 µPt`. `1 Pt` correspond à l'impact total d'un européen sur une année.", "short_unit": "Pts", "decimals": 2, - "pef": null, - "ecoscore": null - }, - "pef": { - "label_en": "PEF Score", - "label_fr": "Score PEF", - "unit_fr": "µPt PEF", - "unit_en": "µPt PEF", - "description_en": "Aggregated impact: sum of the weighted and normalized impact of all environmental impact categories according to the PEF methodology.", - "description_fr": "Impact *agrégé* : somme des impacts **normalisés** et **pondérés** de chaque catégorie d'impact selon la méthode *single score* du PEF. 12 impacts différents pris en compte à ce stade. 4 encore à ajouter.\n\nCet indicateur n'a **pas de dimension**, il se mesure en **Points** (`Pt`), en **milliPoints** (`mPt`) ou en **microPoints** (`µPt`) avec `1 Pt = 1 000 mPt = 1 000 000 µPt`. `1 Pt` correspond à l'impact total d'un européen sur une année.", - "short_unit": "µPt PEF", - "decimals": 2, - "pef": null, "ecoscore": null }, "acd": { @@ -32,11 +19,6 @@ "decimals": 2, "description_en": "Indicator of the **potential acidification of soils and water** due to the release of gases such as nitrogen oxides and sulphur oxides.", "description_fr": "Indicateur de l'**acidification potentielle des sols et des eaux** due à la libération de gaz tels que les oxydes d'azote et les oxydes de soufre.\n\nCet indicateur se mesure en mol (quantité de matière) d'équivalent d'ions hydrogène (`H+`).", - "pef": { - "color": "#ff1493", - "normalization": 5.55695e1, - "weighting": 0.062 - }, "ecoscore": { "color": "#91cf4f", "normalization": 5.55695e1, @@ -52,11 +34,6 @@ "decimals": 2, "description_en": "Indicator of **emissions to air** that cause the **destruction of the stratospheric ozone layer**.", "description_fr": "La couche d'ozone est située en haute altitude dans l'atmosphère, elle protège des rayons ultra-violets solaires. Son appauvrissement augmente l'**exposition de l'ensemble des êtres vivants à ces radiations négatives** (cancérigènes en particulier).\n\nCet indicateur se mesure en kg d'équivalent `CFC 11`, le CFC 11 (trichlorofluorométhane) étant l'un des gaz responsable de l'appauvrissement de la couche d'ozone.", - "pef": { - "color": "#800080", - "normalization": 5.3648e-2, - "weighting": 0.0631 - }, "ecoscore": { "color": "#ffc000", "normalization": 5.3648e-2, @@ -72,11 +49,6 @@ "decimals": 2, "description_en": "Indicator of **potential global warming** due to **emissions of greenhouse gases to air**. Divided into 3 subcategories based on the emission source: (1) fossil resources, (2) bio-based resources and (3) land use change.", "description_fr": "Indicateur le plus connu, correspond à la **modification du climat**, affectant l'écosystème global.\n\nCet indicateur se mesure en kg équivalent `CO₂`, le principal gaz à effet de serre.", - "pef": { - "color": "#800000", - "normalization": 7.55308e3, - "weighting": 0.2106 - }, "ecoscore": { "color": "#9025be", "normalization": 7.55308e3, @@ -92,11 +64,6 @@ "description_fr": "Indicateur correspondant à un **enrichissement excessif des milieux naturels en nutriments**, ce qui conduit à une prolifération et une asphyxie (zone morte). C'est ce phénomène qui est à l'origine des algues vertes. On peut le retrouver en rivière et en lac également.\n\nCet indicateur se mesure en kg d'équivalent Phosphore (`P`), le phosphore étant l'un des éléments responsables de l'eutrophisation des eaux douces.", "short_unit": "kgPe", "decimals": 2, - "pef": { - "color": "#1f7dca", - "normalization": 1.60685, - "weighting": 0.028 - }, "ecoscore": { "color": "#548235", "normalization": 1.60685, @@ -112,11 +79,6 @@ "description_fr": "Indicateur correspondant à un **enrichissement excessif des milieux naturels en nutriments**, ce qui conduit à une prolifération et une asphyxie (zone morte). C'est ce phénomène qui est à l'origine des algues vertes.\n\nCet indicateur se mesure en kg d'équivalent azote (`N`), l'azote étant l'un des éléments responsables de l'eutrophisation des eaux marines.", "short_unit": "kgNe", "decimals": 2, - "pef": { - "color": "#000080", - "normalization": 1.95452e1, - "weighting": 0.0296 - }, "ecoscore": { "color": "#70ad47", "normalization": 1.95452e1, @@ -132,11 +94,6 @@ "description_fr": "Comme dans l'eau, l'eutrophisation terrestre correspond à un **enrichissement excessif du milieu**, en azote en particulier, conduisant a un déséquilibre et un appauvrissement de l'écosystème. Ceci concerne principalement les sols agricoles.\n\nCet indicateur se mesure en mol d'équivalent azote (`N`).", "short_unit": "molNe", "decimals": 2, - "pef": { - "color": "#20b2aa", - "normalization": 1.76755e2, - "weighting": 0.0371 - }, "ecoscore": { "color": "#c5e0b4", "normalization": 1.76755e2, @@ -152,11 +109,6 @@ "description_fr": "Indicateur correspondant à la **dégradation de la qualité de l'air**, principalement via la formation de brouillard de basse altitude nommé *smog*. Il a des conséquences néfastes sur la santé.\n\nCet indicateur se mesure en kg d'équivalent Composés Organiques Volatiles Non Méthaniques (`COVNM`), un ensemble de composés organiques (alcools, aromatiques,...) contribuant à la formation d'ozone photochimique.", "short_unit": "kgNMVOCe", "decimals": 2, - "pef": { - "color": "#da70d6", - "normalization": 4.08592e1, - "weighting": 0.0478 - }, "ecoscore": { "color": "#ff6161", "normalization": 4.08592e1, @@ -172,11 +124,6 @@ "description_fr": "Indicateur correspondant aux **effets négatifs sur la santé humaine** causés par les émissions de particules (`PM`) et de leurs précurseurs (`NOx`, `SOx`, `NH3`).\n\nCet indicateur se mesure en incidence de maladie supplémentaire due aux particules", "short_unit": "dis.inc.", "decimals": 2, - "pef": { - "color": "#696969", - "normalization": 5.95367e-4, - "weighting": 0.0896 - }, "ecoscore": { "color": "#ffc000", "normalization": 5.95367e-4, @@ -192,11 +139,6 @@ "description_fr": "Indicateur correspondant aux dommages pour la **santé humaine et les écosystèmes** liés aux émissions de radionucléides.\n\nIl se mesure en kilobecquerel d'equivalent `Uranium 235`.", "short_unit": "kBqU235e", "decimals": 2, - "pef": { - "color": "#ffd700", - "normalization": 4.22016e3, - "weighting": 0.0501 - }, "ecoscore": { "color": "#be8f00", "normalization": 4.22016e3, @@ -212,11 +154,6 @@ "description_fr": "Indicateur de l'**épuisement des ressources naturelles en combustibles fossiles** (gaz, charbon, pétrole).\n\nIl se mesure en mégajoules (`MJ`), la quantité d'énergie fossile utilisée.", "short_unit": "MJ", "decimals": 2, - "pef": { - "color": "#000000", - "normalization": 6.50043e4, - "weighting": 0.0832 - }, "ecoscore": { "color": "#9dc3e6", "normalization": 6.50043e4, @@ -232,11 +169,6 @@ "description_fr": "Indicateur de l'**épuisement des ressources naturelles non fossiles**.\n\nIl se mesure en kg d'équivalent d'antimoine (`Sb`) (élément métallique).", "short_unit": "kgSbe", "decimals": 2, - "pef": { - "color": "#a9a9a9", - "normalization": 6.36226e-2, - "weighting": 0.0755 - }, "ecoscore": { "color": "#698ed0", "normalization": 6.36226e-2, @@ -252,11 +184,6 @@ "description_fr": "Mesure de l'évolution de la **qualité des sols** (production biotique, résistance à l'érosion, filtration mécanique).\n\nCet indicateur n'a pas de dimension, il se mesure en Points (`Pt`).", "short_unit": "Pt", "decimals": 2, - "pef": { - "color": "#006400", - "normalization": 8.19498e5, - "weighting": 0.0794 - }, "ecoscore": { "color": "#a9d18e", "normalization": 8.19498e5, @@ -272,11 +199,6 @@ "description_fr": "Indicateur de la consommation d'eau et son épuisement dans certaines régions. **À ce stade, elle n'est prise en compte que pour l'étape “Matière & Filature”.**\n\nCet indicateur se mesure en **mètre cube (`m³`)** d'eau consommé.", "short_unit": "m³", "decimals": 2, - "pef": { - "color": "#00ffff", - "normalization": 1.14687e4, - "weighting": 0.0851 - }, "ecoscore": { "color": "#0070c0", "normalization": 1.14687e4, @@ -292,11 +214,6 @@ "description_fr": "Indicateur d'écotoxicité pour écosystèmes aquatiques d'eau douce. Cet indicateur se mesure en Comparative Toxic Unit for ecosystems (CTUe)", "short_unit": "CTUe", "decimals": 2, - "pef": { - "color": "#03A764", - "normalization": 5.67166e4, - "weighting": 0.0192 - }, "ecoscore": null }, "etf-c": { @@ -308,7 +225,6 @@ "description_fr": "Indicateur d'écotoxicité pour écosystèmes aquatiques d'eau douce. Cet indicateur se mesure en Comparative Toxic Unit for ecosystems (CTUe). Cet indicateur est corrigé.", "short_unit": "CTUe", "decimals": 2, - "pef": null, "ecoscore": { "color": "#375622", "normalization": 9.812e4, @@ -328,11 +244,6 @@ "description_fr": "Indicateur de toxicité cancérigène pour l'homme. Cet indicateur se mesure en Comparative Toxic Unit for humans (CTUh)", "short_unit": "CTUh", "decimals": 2, - "pef": { - "color": "#ffff00", - "normalization": 1.72529e-5, - "weighting": 0.0213 - }, "ecoscore": null }, "htc-c": { @@ -344,7 +255,6 @@ "description_fr": "Indicateur de toxicité cancérigène pour l'homme. Cet indicateur se mesure en Comparative Toxic Unit for humans (CTUh). Cet indicateur est corrigé.", "short_unit": "CTUh", "decimals": 2, - "pef": null, "ecoscore": { "color": "#f4b183", "normalization": 1.72529e-5, @@ -364,11 +274,6 @@ "description_fr": "Indicateur de toxicité non cancérigène pour l'homme. Cet indicateur se mesure en Comparative Toxic Unit for humans (CTUh)", "short_unit": "CTUh", "decimals": 2, - "pef": { - "color": "#FFA907", - "normalization": 1.28736e-4, - "weighting": 0.0184 - }, "ecoscore": null }, "htn-c": { @@ -380,7 +285,6 @@ "description_fr": "Indicateur de toxicité non cancérigène pour l'homme. Cet indicateur se mesure en Comparative Toxic Unit for humans (CTUh). Cet indicateur est corrigé.", "short_unit": "CTUh", "decimals": 2, - "pef": null, "ecoscore": { "color": "#43682b", "normalization": 1.28736e-4, diff --git a/src/Data/Impact.elm b/src/Data/Impact.elm index 79573e3e5..01f9acfe2 100644 --- a/src/Data/Impact.elm +++ b/src/Data/Impact.elm @@ -419,7 +419,6 @@ decodeWithoutAggregated = Definition.decodeWithoutAggregated (always Unit.decodeImpact) -- Those aggregated impacts will have to be computed after the decoding |> Pipe.hardcoded Quantity.zero - |> Pipe.hardcoded Quantity.zero |> Decode.map Impacts @@ -446,7 +445,6 @@ updateAggregatedScores definitions impacts = in impacts |> aggregateScore .ecoscoreData Definition.Ecs - |> aggregateScore .pefData Definition.Pef getAggregatedScoreData : diff --git a/src/Data/Impact/Definition.elm b/src/Data/Impact/Definition.elm index 47ffa37ab..fef41dbde 100644 --- a/src/Data/Impact/Definition.elm +++ b/src/Data/Impact/Definition.elm @@ -62,7 +62,6 @@ type Trigram | Wtu -- Aggregated scores | Ecs - | Pef type alias Definition = @@ -71,7 +70,6 @@ type alias Definition = , description : String , unit : String , decimals : Int - , pefData : Maybe AggregatedScoreData , ecoscoreData : Maybe AggregatedScoreData } @@ -103,7 +101,6 @@ type alias Trigrams a = -- Aggregated scores , ecs : a - , pef : a } @@ -139,7 +136,6 @@ init a = -- Aggregated scores , ecs = a - , pef = a } @@ -207,9 +203,6 @@ update trigram updateFunc definitions = Ecs -> { definitions | ecs = updateFunc definitions.ecs } - Pef -> - { definitions | pef = updateFunc definitions.pef } - trigrams : List Trigram trigrams = @@ -235,7 +228,6 @@ trigrams = -- Aggregated scores , Ecs - , Pef ] @@ -309,9 +301,6 @@ get trigram definitions = Ecs -> definitions.ecs - Pef -> - definitions.pef - map : (Trigram -> a -> b) -> Trigrams a -> Trigrams b map func definitions = @@ -337,7 +326,6 @@ map func definitions = -- Aggregated scores , ecs = func Ecs definitions.ecs - , pef = func Pef definitions.pef } @@ -430,9 +418,6 @@ toString trigram = Ecs -> "ecs" - Pef -> - "pef" - toTrigram : String -> Result String Trigram toTrigram str = @@ -498,23 +483,20 @@ toTrigram str = "ecs" -> Ok Ecs - "pef" -> - Ok Pef - _ -> Err <| "Trigramme d'impact inconnu: " ++ str isAggregate : Trigram -> Bool isAggregate trigram = - trigram == Pef || trigram == Ecs + trigram == Ecs ---- Decoders -decodeWithoutAggregated : (String -> Decoder a) -> Decoder (a -> a -> Trigrams a) +decodeWithoutAggregated : (String -> Decoder a) -> Decoder (a -> Trigrams a) decodeWithoutAggregated decoder = Decode.succeed Trigrams |> Pipe.required "acd" (decoder "acd") @@ -542,7 +524,6 @@ decodeBase : (String -> Decoder a) -> Decoder (Trigrams a) decodeBase decoder = decodeWithoutAggregated decoder |> Pipe.required "ecs" (decoder "ecs") - |> Pipe.required "pef" (decoder "pef") decode : Decoder Definitions @@ -566,7 +547,6 @@ decodeDefinition trigram = |> Pipe.required "description_fr" Decode.string |> Pipe.required "short_unit" Decode.string |> Pipe.required "decimals" Decode.int - |> Pipe.required "pef" (Decode.maybe decodeAggregatedScoreData) |> Pipe.required "ecoscore" (Decode.maybe decodeAggregatedScoreData) diff --git a/src/Page/Explore/Impacts.elm b/src/Page/Explore/Impacts.elm index 06d9c0189..a7ed6c6e5 100644 --- a/src/Page/Explore/Impacts.elm +++ b/src/Page/Explore/Impacts.elm @@ -61,26 +61,6 @@ table { detailed, scope } = >> Maybe.withDefault 0 , toCell = .ecoscoreData >> Maybe.map (.weighting >> Format.splitAsPercentage 2) >> Maybe.withDefault (text "N/A") } - , { label = "Normalisation (PEF)" - , toValue = - Table.FloatValue <| - .pefData - >> Maybe.map (.normalization >> Unit.impactToFloat) - >> Maybe.withDefault 0 - , toCell = - \def -> - def.pefData - |> Maybe.map (.normalization >> Unit.impactToFloat >> Format.formatRichFloat 2 def.unit) - |> Maybe.withDefault (text "N/A") - } - , { label = "Pondération (PEF)" - , toValue = - Table.FloatValue <| - .pefData - >> Maybe.map (.weighting >> Split.toFloat) - >> Maybe.withDefault 0 - , toCell = .pefData >> Maybe.map (.weighting >> Format.splitAsPercentage 2) >> Maybe.withDefault (text "N/A") - } , { label = "Description" , toValue = Table.StringValue .description , toCell = diff --git a/tests/Data/DefinitionTest.elm b/tests/Data/DefinitionTest.elm index e860f2f2a..122ab5878 100644 --- a/tests/Data/DefinitionTest.elm +++ b/tests/Data/DefinitionTest.elm @@ -18,8 +18,8 @@ suite = (\db -> [ Definition.trigrams |> List.length - |> Expect.equal 21 - |> asTest "There are 21 impact trigrams" + |> Expect.equal 20 + |> asTest "There are 20 impact trigrams" , Definition.trigrams |> List.map ((\trigram -> Definition.get trigram db.definitions) >> .trigram >> Definition.toString) |> Set.fromList @@ -57,12 +57,12 @@ suite = |> asTest "filter will zero all the values for fields filtered out" , Definition.toList db.definitions |> List.length - |> Expect.equal 21 - |> asTest "there are 21 impacts in total" + |> Expect.equal 20 + |> asTest "there are 20 impacts in total" , Definition.init 1 |> Definition.filter Definition.isAggregate (always 0) |> sumDefinitions - |> Expect.equal 2 - |> asTest "There are exactly two aggregated scores" + |> Expect.equal 1 + |> asTest "There is exactly one aggregated score" ] ) diff --git a/tests/Data/Food/RecipeTest.elm b/tests/Data/Food/RecipeTest.elm index c8b2c0f77..cf713579a 100644 --- a/tests/Data/Food/RecipeTest.elm +++ b/tests/Data/Food/RecipeTest.elm @@ -131,7 +131,6 @@ suite = , mru = Expect.greaterThan 0 , ozd = Expect.greaterThan 0 , pco = Expect.greaterThan 0 - , pef = Expect.greaterThan 0 , pma = Expect.greaterThan 0 , swe = Expect.greaterThan 0 , tre = Expect.greaterThan 0 diff --git a/tests/Data/ImpactTest.elm b/tests/Data/ImpactTest.elm index b788d73f8..5638d9d40 100644 --- a/tests/Data/ImpactTest.elm +++ b/tests/Data/ImpactTest.elm @@ -27,13 +27,13 @@ suite = [ describe "computeAggregatedScore" [ defaultImpacts |> Impact.updateImpact db.definitions Definition.Cch (Unit.impact 1) - |> Impact.getImpact Definition.Pef + |> Impact.getImpact Definition.Ecs |> expectScoreEquals 27.88266508497196 |> asTest "should compute aggregate score from cch impact" , defaultImpacts |> Impact.updateImpact db.definitions Definition.Fwe (Unit.impact 1) - |> Impact.getImpact Definition.Pef - |> expectScoreEquals 17425.397516880857 + |> Impact.getImpact Definition.Ecs + |> expectScoreEquals 13815.850888384108 |> asTest "should compute aggregate score from fwe impact" ] , describe "mapImpacts" @@ -90,10 +90,6 @@ suite = |> Impact.getImpact Definition.Ecs |> expectScoreEquals 13843.73355346908 |> asTest "should update EcoScore" - , impacts - |> Impact.getImpact Definition.Pef - |> expectScoreEquals 17453.28018196583 - |> asTest "should update PEF score" ] , describe "total weighting for impacts' ecoscoreData" [ Definition.trigrams @@ -105,15 +101,5 @@ suite = |> Expect.within (Expect.Absolute 0.01) 1 |> asTest "should be 1" ] - , describe "total weighting for impacts' pefData" - [ Definition.trigrams - |> List.map (\trigram -> Definition.get trigram db.definitions) - |> List.filterMap .pefData - |> List.map .weighting - |> List.map Split.toFloat - |> List.sum - |> Expect.within (Expect.Absolute 0.01) 1 - |> asTest "should be 1" - ] ] ) diff --git a/tests/e2e-food.json b/tests/e2e-food.json index 82c6fe328..7f8240c75 100644 --- a/tests/e2e-food.json +++ b/tests/e2e-food.json @@ -22,8 +22,7 @@ "swe": 0.00327751466189682, "tre": 0.0365913234765909, "wtu": 0.27156067319612565, - "ecs": 132.8924956475673, - "pef": 132.56803849539975 + "ecs": 132.8924956475673 }, "scoring": { "all": 1384.2968296621593, @@ -56,8 +55,7 @@ "swe": 0.0004467979943975832, "tre": 0.005630688694881073, "wtu": 0.24424086870863998, - "ecs": 20.7458082291587, - "pef": 19.053175389475143 + "ecs": 20.7458082291587 }, "scoring": { "all": 216.10216905373647, @@ -90,8 +88,7 @@ "swe": 0.0015276321235013306, "tre": 0.017442682418193894, "wtu": 0.25590278135682243, - "ecs": 64.5654349645626, - "pef": 63.24101142364565 + "ecs": 64.5654349645626 }, "scoring": { "all": 672.5566142141937, @@ -124,8 +121,7 @@ "swe": 0.0015276321235013306, "tre": 0.017442682418193894, "wtu": 0.25590278135682243, - "ecs": 64.5654349645626, - "pef": 63.24101142364565 + "ecs": 64.5654349645626 }, "scoring": { "all": 672.5566142141937, @@ -158,8 +154,7 @@ "swe": 0.00021466599695441275, "tre": 0.003076894481790315, "wtu": 0.2464233599603919, - "ecs": 13.136845052352431, - "pef": 11.251013762135303 + "ecs": 13.136845052352431 }, "scoring": { "all": 136.84213596200448, diff --git a/tests/e2e-textile.json b/tests/e2e-textile.json index ee03eaee0..04a633225 100644 --- a/tests/e2e-textile.json +++ b/tests/e2e-textile.json @@ -29,8 +29,7 @@ "swe": 0.025467662607441162, "tre": 0.12648609991631055, "wtu": 14.022971246600134, - "ecs": 1473.9780976999311, - "pef": 942.9643784896306 + "ecs": 1473.9780976999311 } }, { @@ -64,8 +63,7 @@ "swe": 0.02494838859581367, "tre": 0.1196338735708263, "wtu": 14.167230364956025, - "ecs": 1450.2914354053546, - "pef": 919.7149683050168 + "ecs": 1450.2914354053546 } }, { @@ -99,8 +97,7 @@ "swe": 0.011781122757516282, "tre": 0.07959215390253874, "wtu": 1.1726385765499685, - "ecs": 1622.3567024833867, - "pef": 1148.1148870018326 + "ecs": 1622.3567024833867 } }, { @@ -135,8 +132,7 @@ "swe": 0.015320376929918441, "tre": 0.08079622398774226, "wtu": 6.9639123932412055, - "ecs": 1267.9101496135304, - "pef": 811.4356101328748 + "ecs": 1267.9101496135304 } }, { @@ -170,8 +166,7 @@ "swe": 0.022668187659341657, "tre": 0.11804694713872195, "wtu": 13.941791629352936, - "ecs": 1216.7933769403794, - "pef": 714.3342887484364 + "ecs": 1216.7933769403794 } }, { @@ -207,8 +202,7 @@ "swe": 0.08000116470598892, "tre": 0.5022110547143145, "wtu": 35.180613817523366, - "ecs": 4811.167813476992, - "pef": 3052.638092437028 + "ecs": 4811.167813476992 } }, { @@ -243,8 +237,7 @@ "swe": 0.08611009389584703, "tre": 0.4635144069953214, "wtu": 41.14890419887185, - "ecs": 4949.858297610277, - "pef": 3134.1630944264157 + "ecs": 4949.858297610277 } }, { @@ -279,8 +272,7 @@ "swe": 0.07953020200552749, "tre": 0.42425784859037785, "wtu": 40.78389572826903, - "ecs": 4646.99066487436, - "pef": 2798.276588760015 + "ecs": 4646.99066487436 } }, { @@ -315,8 +307,7 @@ "swe": 0.025467662607441162, "tre": 0.12648609991631055, "wtu": 14.022971246600134, - "ecs": 1473.9780976999311, - "pef": 942.9643784896306 + "ecs": 1473.9780976999311 } }, { @@ -350,8 +341,7 @@ "swe": 0.02176633947907204, "tre": 0.10827607026526874, "wtu": 11.933371318307108, - "ecs": 1304.0314709229826, - "pef": 840.4876551108515 + "ecs": 1304.0314709229826 } }, { @@ -385,8 +375,7 @@ "swe": 0.028757727610435928, "tre": 0.14267279293945884, "wtu": 15.880393405082835, - "ecs": 1625.0417659461073, - "pef": 1034.0547992707675 + "ecs": 1625.0417659461073 } }, { @@ -421,8 +410,7 @@ "swe": 0.04480609001594954, "tre": 0.22219859194137329, "wtu": 24.71605261646426, - "ecs": 2570.5571191805325, - "pef": 1627.7398706444221 + "ecs": 2570.5571191805325 } }, { @@ -457,8 +445,7 @@ "swe": 0.04585545725852972, "tre": 0.22419877014322215, "wtu": 24.7331635965313, - "ecs": 2623.782882214503, - "pef": 1659.9240056636133 + "ecs": 2623.782882214503 } }, { @@ -493,8 +480,7 @@ "swe": 0.045913628016308994, "tre": 0.22447334781625053, "wtu": 24.735968059012894, - "ecs": 2612.3753854906913, - "pef": 1664.4974402015926 + "ecs": 2612.3753854906913 } }, { @@ -529,8 +515,7 @@ "swe": 0.046138040891082525, "tre": 0.2269599906040805, "wtu": 24.758830066631848, - "ecs": 2697.130941987712, - "pef": 1700.4341552101737 + "ecs": 2697.130941987712 } }, { @@ -564,8 +549,7 @@ "swe": 0.000983845919096806, "tre": 0.006500693022400001, "wtu": 0.13495760676979718, - "ecs": 320.49211185973485, - "pef": 310.761127204542 + "ecs": 320.49211185973485 } } ] diff --git a/tests/server.spec.js b/tests/server.spec.js index 4246f5a7b..09d9a700b 100644 --- a/tests/server.spec.js +++ b/tests/server.spec.js @@ -158,11 +158,11 @@ describe("API", () => { ); }); - it("should perform a simulation featuring 21 impacts for textile", async () => { + it("should perform a simulation featuring 20 impacts for textile", async () => { const response = await makeRequest("/api/textile/simulator/", successQuery); expectStatus(response, 200); - expect(Object.keys(response.body.impacts)).toHaveLength(21); + expect(Object.keys(response.body.impacts)).toHaveLength(20); }); it("should validate the airTransportRatio param", async () => { @@ -283,7 +283,7 @@ describe("API", () => { }); describe("POST", () => { - it("should compute 21 impacts", async () => { + it("should compute 20 impacts", async () => { const response = await makePostRequest("/api/textile/simulator", { mass: 0.17, materials: [{ id: "ei-coton", share: 1 }], @@ -299,7 +299,7 @@ describe("API", () => { disabledSteps: ["use"], }); expectStatus(response, 200); - expect(Object.keys(response.body.impacts)).toHaveLength(21); + expect(Object.keys(response.body.impacts)).toHaveLength(20); }); }); }); @@ -409,7 +409,7 @@ describe("API", () => { describe("/food", () => { describe("GET", () => { - it("should compute 21 impacts for food", async () => { + it("should compute 20 impacts for food", async () => { const response = await makeRequest("/api/food", [ "ingredients[]=carrot-fr;268", "transform=AGRIBALU000000003103966;1050", @@ -417,7 +417,7 @@ describe("API", () => { ]); expectStatus(response, 200); - expect(Object.keys(response.body.results.total)).toHaveLength(21); + expect(Object.keys(response.body.results.total)).toHaveLength(20); }); it("should validate an ingredient id", async () => { @@ -510,7 +510,7 @@ describe("API", () => { }); describe("POST", () => { - it("should compute 21 impacts", async () => { + it("should compute 20 impacts", async () => { const response = await makePostRequest("/api/food", { ingredients: [ { id: "egg-indoor-code3", mass: 0.12 }, @@ -533,7 +533,7 @@ describe("API", () => { }); expectStatus(response, 200); - expect(Object.keys(response.body.results.total)).toHaveLength(21); + expect(Object.keys(response.body.results.total)).toHaveLength(20); }); }); });