From fffacbb2743cc8c63519264c3aeb1a545c2c5022 Mon Sep 17 00:00:00 2001 From: jacobvjk Date: Tue, 3 Mar 2026 17:52:37 +0100 Subject: [PATCH 1/5] remove policyType direct policy and reclassify --- public/schema/pathwayMetadata.v1.html | 1 - src/components/Badge.test.tsx | 6 +++--- src/components/SearchSection.test.tsx | 1 - src/components/StepByStepGuide.tsx | 7 +++---- src/data/README.md | 2 +- .../philippines-department-of-energy/PHDOE-CES1-2023.json | 2 +- .../philippines-department-of-energy/PHDOE-CES2-2023.json | 2 +- .../PHDOE-REFERENCE-2023.json | 2 +- src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json | 2 +- src/schema/pathwayMetadata.v1.json | 2 +- src/types/pathwayMetadata.v1.d.ts | 2 +- src/utils/searchUtils.test.tsx | 7 +++---- src/utils/sortUtils.test.tsx | 5 ----- src/utils/sortUtils.ts | 7 +------ src/utils/tooltipUtils.ts | 8 +++----- testdata/valid/pathwayMetadata_sample_03.json | 2 +- 16 files changed, 21 insertions(+), 37 deletions(-) diff --git a/public/schema/pathwayMetadata.v1.html b/public/schema/pathwayMetadata.v1.html index b65eb1ab..fbb74a9d 100644 --- a/public/schema/pathwayMetadata.v1.html +++ b/public/schema/pathwayMetadata.v1.html @@ -9296,7 +9296,6 @@

Must be one of:

diff --git a/src/components/Badge.test.tsx b/src/components/Badge.test.tsx index 00fd6c7c..db263775 100644 --- a/src/components/Badge.test.tsx +++ b/src/components/Badge.test.tsx @@ -225,14 +225,14 @@ describe("Badge component", () => { it("displays correct tooltip for Policy pathway type", () => { render( - Direct Policy + Normative , ); - const badge = screen.getByText("Direct Policy"); + const badge = screen.getByText("Normative"); expect(badge).toBeInTheDocument(); expect(badge.closest("span")?.parentElement).toHaveAttribute( "tabindex", diff --git a/src/components/SearchSection.test.tsx b/src/components/SearchSection.test.tsx index fc4874f4..0e4cc8bc 100644 --- a/src/components/SearchSection.test.tsx +++ b/src/components/SearchSection.test.tsx @@ -136,7 +136,6 @@ describe("SearchSection", () => { openByLabel("Sector"); openByLabel("Pathway Type"); - expect(screen.getByText("Direct Policy")).toBeInTheDocument(); expect(screen.getByText("Exploratory")).toBeInTheDocument(); expect(screen.getByText("Normative")).toBeInTheDocument(); expect(screen.getByText("Predictive")).toBeInTheDocument(); diff --git a/src/components/StepByStepGuide.tsx b/src/components/StepByStepGuide.tsx index bb890cd0..261dde7f 100644 --- a/src/components/StepByStepGuide.tsx +++ b/src/components/StepByStepGuide.tsx @@ -87,10 +87,9 @@ const StepByStepGuide: React.FC = ({ const descriptions: Record> = { pathwayType: { - "Direct Policy": "Sourced directly from policy frameworks", - "Exploratory": "Future states under explicit assumptions", - "Normative": "Pre-determined target outcome", - "Predictive": "Extrapolates from current trends", + Exploratory: "Future states under explicit assumptions", + Normative: "Pre-determined target outcome", + Predictive: "Extrapolates from current trends", }, emissionsTrajectory: { "Significant increase": "Grow more than 50% by 2050", diff --git a/src/data/README.md b/src/data/README.md index 6eca55ea..3d1cdd8f 100644 --- a/src/data/README.md +++ b/src/data/README.md @@ -79,7 +79,7 @@ new_pathway_metadata <- id = "R-import-example", name = "R Import Pathway", description = "Pathway Imported from R", - pathwayType = "Direct Policy", + pathwayType = "Normative", modelYearEnd = 2050, modelTempIncrease = 1.5, geography = list("Global", "US", "Europe"), diff --git a/src/data/philippines-department-of-energy/PHDOE-CES1-2023.json b/src/data/philippines-department-of-energy/PHDOE-CES1-2023.json index 6e8af5bf..999ceed3 100644 --- a/src/data/philippines-department-of-energy/PHDOE-CES1-2023.json +++ b/src/data/philippines-department-of-energy/PHDOE-CES1-2023.json @@ -19,7 +19,7 @@ "name": { "full": "Clean Energy Scenario 1", "short": "CES 1" }, "description": "Philippines pathway following National Renewable Energy Plan with some offshore wind development.", "geography": ["PH"], - "pathwayType": "Direct Policy", + "pathwayType": "Exploratory", "modelYearStart": 2023, "modelYearEnd": 2050, "sectors": [ diff --git a/src/data/philippines-department-of-energy/PHDOE-CES2-2023.json b/src/data/philippines-department-of-energy/PHDOE-CES2-2023.json index 4bcd8e7f..ca50611f 100644 --- a/src/data/philippines-department-of-energy/PHDOE-CES2-2023.json +++ b/src/data/philippines-department-of-energy/PHDOE-CES2-2023.json @@ -19,7 +19,7 @@ "name": { "full": "Clean Energy Scenario 2", "short": "CES 2" }, "description": "Philippines pathway following National Renewable Energy Plan. Significant offshore wind development.", "geography": ["PH"], - "pathwayType": "Direct Policy", + "pathwayType": "Exploratory", "modelYearStart": 2023, "modelYearEnd": 2050, "sectors": [ diff --git a/src/data/philippines-department-of-energy/PHDOE-REFERENCE-2023.json b/src/data/philippines-department-of-energy/PHDOE-REFERENCE-2023.json index afbf1c03..2c87b264 100644 --- a/src/data/philippines-department-of-energy/PHDOE-REFERENCE-2023.json +++ b/src/data/philippines-department-of-energy/PHDOE-REFERENCE-2023.json @@ -19,7 +19,7 @@ "name": { "full": "Reference Scenario", "short": "Reference" }, "description": "Continuation of historical trends in the energy system in the Philippines.", "geography": ["PH"], - "pathwayType": "Direct Policy", + "pathwayType": "Exploratory", "modelYearStart": 2023, "modelYearEnd": 2050, "sectors": [ diff --git a/src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json b/src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json index 5d31abf4..6154c996 100644 --- a/src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json +++ b/src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json @@ -30,7 +30,7 @@ }, "description": "Singapore-specific pathway reflecting existing policy commitments and government targets.", "geography": ["SG"], - "pathwayType": "Direct Policy", + "pathwayType": "Exploratory", "modelYearStart": 2023, "modelYearEnd": 2050, "ssp": "SSP2", diff --git a/src/schema/pathwayMetadata.v1.json b/src/schema/pathwayMetadata.v1.json index afabd487..ac81bd42 100644 --- a/src/schema/pathwayMetadata.v1.json +++ b/src/schema/pathwayMetadata.v1.json @@ -34,7 +34,7 @@ "pathwayType": { "description": "Type of the pathway pathway.", "type": "string", - "enum": ["Normative", "Exploratory", "Direct Policy", "Predictive"] + "enum": ["Normative", "Exploratory", "Predictive"] }, "modelYearNetzero": { "description": "Year by which net zero is reached in the pathway. If Pathway does not reach net zero, this field should be omitted.", diff --git a/src/types/pathwayMetadata.v1.d.ts b/src/types/pathwayMetadata.v1.d.ts index cacae4a3..d52f2c56 100644 --- a/src/types/pathwayMetadata.v1.d.ts +++ b/src/types/pathwayMetadata.v1.d.ts @@ -43,7 +43,7 @@ export interface PathwayMetadataV1 { /** * Type of the pathway pathway. */ - pathwayType: "Normative" | "Exploratory" | "Direct Policy" | "Predictive"; + pathwayType: "Normative" | "Exploratory" | "Predictive"; /** * Year by which net zero is reached in the pathway. If Pathway does not reach net zero, this field should be omitted. */ diff --git a/src/utils/searchUtils.test.tsx b/src/utils/searchUtils.test.tsx index c2c88e3d..bee76576 100644 --- a/src/utils/searchUtils.test.tsx +++ b/src/utils/searchUtils.test.tsx @@ -233,7 +233,7 @@ describe("filterPathways (array-backed facets)", () => { sectors: [{ name: "Power" }], geography: ["Europe"], modelTempIncrease: 2.0, - pathwayType: "Direct Policy", + pathwayType: "Normative", modelYearNetzero: 2040, publisher: "X", publicationYear: 2020, @@ -255,7 +255,7 @@ describe("filterPathways (array-backed facets)", () => { it("pathwayType: OR over multiple selections; empty array = no filter", () => { let out = filterPathways(pathways, { - pathwayType: ["Direct Policy", "Exploratory"], + pathwayType: ["Normative", "Exploratory"], } as FiltersWithArrays); expect(out.map((s) => s.id)).toEqual(["B", "C"]); @@ -492,11 +492,10 @@ describe("getGlobalFacetOptions", () => { // pathwayTypeOptions should be in expected order const pathwayTypeLabels = pathwayTypeOptions.map((opt) => opt.label); - expect(pathwayTypeLabels.slice(0, 4)).toEqual([ + expect(pathwayTypeLabels.slice(0, 3)).toEqual([ "Predictive", "Exploratory", "Normative", - "Direct Policy", ]); }); diff --git a/src/utils/sortUtils.test.tsx b/src/utils/sortUtils.test.tsx index 18ecc760..5d4db85e 100644 --- a/src/utils/sortUtils.test.tsx +++ b/src/utils/sortUtils.test.tsx @@ -5,7 +5,6 @@ describe("sortPathwayType", () => { const arr = [ { title: "Normative" }, { title: "Predictive" }, - { title: "Direct Policy" }, { title: "Exploratory" }, ]; const sorted = sortPathwayType(arr); @@ -13,7 +12,6 @@ describe("sortPathwayType", () => { "Predictive", "Exploratory", "Normative", - "Direct Policy", ]); }); @@ -22,13 +20,11 @@ describe("sortPathwayType", () => { { title: "Normative" }, { title: "UnknownType" }, { title: "Predictive" }, - { title: "Direct Policy" }, ]; const sorted = sortPathwayType(arr); expect(sorted.map((x) => x.title)).toEqual([ "Predictive", "Normative", - "Direct Policy", "UnknownType", ]); // UnknownType is last @@ -43,7 +39,6 @@ describe("sortPathwayType", () => { const arr = [ { title: "Normative" }, { title: "Predictive" }, - { title: "Direct Policy" }, { title: "Exploratory" }, ]; const arrCopy = [...arr]; diff --git a/src/utils/sortUtils.ts b/src/utils/sortUtils.ts index 0ba8d7e7..2f69cb49 100644 --- a/src/utils/sortUtils.ts +++ b/src/utils/sortUtils.ts @@ -43,12 +43,7 @@ export const prioritizeGeographies = ( }; // Utility for sorting pathway types according to a fixed order -export const pathwayTypeOrder = [ - "Predictive", - "Exploratory", - "Normative", - "Direct Policy", -]; +export const pathwayTypeOrder = ["Predictive", "Exploratory", "Normative"]; export function sortPathwayType(arr: T[]): T[] { return arr.slice().sort((a, b) => { diff --git a/src/utils/tooltipUtils.ts b/src/utils/tooltipUtils.ts index 999ee0d9..42c7df1a 100644 --- a/src/utils/tooltipUtils.ts +++ b/src/utils/tooltipUtils.ts @@ -8,11 +8,9 @@ import type { export const unknownTooltip = "No tooltip available."; export const pathwayTypeTooltips: Record = { - "Direct Policy": - "Outcomes based on legislated policy targets or commitments.", - "Exploratory": "Examines a range of plausible futures without fixed goals.", - "Normative": "Starts from a desired end state and works backward to actions.", - "Predictive": + Exploratory: "Examines a range of plausible futures without fixed goals.", + Normative: "Starts from a desired end state and works backward to actions.", + Predictive: "Projects likely futures based on current trends and assumptions.", }; diff --git a/testdata/valid/pathwayMetadata_sample_03.json b/testdata/valid/pathwayMetadata_sample_03.json index b20d7213..33e42e28 100644 --- a/testdata/valid/pathwayMetadata_sample_03.json +++ b/testdata/valid/pathwayMetadata_sample_03.json @@ -8,7 +8,7 @@ "year": 2024 }, "description": "Third Sample Pathway. asdf description.", - "pathwayType": "Direct Policy", + "pathwayType": "Normative", "modelTempIncrease": 3, "ssp": "SSP3", "geography": ["North America"], From 9ab5c8602f41743bb13c9901c52517e3470250af Mon Sep 17 00:00:00 2001 From: jacobvjk Date: Tue, 3 Mar 2026 17:57:11 +0100 Subject: [PATCH 2/5] feat: remove pathwayType Direct Policy From 9eb499cfa5ad5b136f3d40705536b9f99832be01 Mon Sep 17 00:00:00 2001 From: Jacob Kastl <60064070+jacobvjk@users.noreply.github.com> Date: Tue, 3 Mar 2026 17:58:55 +0100 Subject: [PATCH 3/5] Update src/data/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/data/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/README.md b/src/data/README.md index 3d1cdd8f..3f266fdd 100644 --- a/src/data/README.md +++ b/src/data/README.md @@ -79,7 +79,7 @@ new_pathway_metadata <- id = "R-import-example", name = "R Import Pathway", description = "Pathway Imported from R", - pathwayType = "Normative", + pathwayType = "Normative", modelYearEnd = 2050, modelTempIncrease = 1.5, geography = list("Global", "US", "Europe"), From 761a87622cedbd9a7fd6ee37244f5ca7aa895595 Mon Sep 17 00:00:00 2001 From: jacobvjk Date: Tue, 3 Mar 2026 18:01:45 +0100 Subject: [PATCH 4/5] update test to retain meaningful coverage --- src/components/Badge.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Badge.test.tsx b/src/components/Badge.test.tsx index db263775..10344c36 100644 --- a/src/components/Badge.test.tsx +++ b/src/components/Badge.test.tsx @@ -222,17 +222,17 @@ describe("Badge component", () => { ); }); - it("displays correct tooltip for Policy pathway type", () => { + it("displays correct tooltip for Exploratory pathway type", () => { render( - Normative + Exploratory , ); - const badge = screen.getByText("Normative"); + const badge = screen.getByText("Exploratory"); expect(badge).toBeInTheDocument(); expect(badge.closest("span")?.parentElement).toHaveAttribute( "tabindex", From 22145814d80b12cfc93f78f5c07b87401dfe0bc3 Mon Sep 17 00:00:00 2001 From: jacobvjk Date: Wed, 4 Mar 2026 12:14:10 +0100 Subject: [PATCH 5/5] update classification --- src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json b/src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json index 6154c996..749b81aa 100644 --- a/src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json +++ b/src/data/un-sdsn-cw/SDSN-CW-BAU-SG-2024.json @@ -30,7 +30,7 @@ }, "description": "Singapore-specific pathway reflecting existing policy commitments and government targets.", "geography": ["SG"], - "pathwayType": "Exploratory", + "pathwayType": "Predictive", "modelYearStart": 2023, "modelYearEnd": 2050, "ssp": "SSP2",