Skip to content

Data: IEA pathways spell the same region two ways across metadata and timeseries #945

Description

@jacobvjk

Found while implementing the detail-page scope filters (#872). Data only — no code change proposed here.

The mismatch

IEA-APS-2024 and IEA-STEPS-2024 spell the same region two different ways in their own two files:

value
src/data/iea/IEA-APS-2024.json → geography.regions key Southeast Asia
src/data/iea/IEA-APS-2024_timeseries.json → data[].geography South East Asia

Identical for IEA-STEPS-2024. For contrast, all four ACE pathways use South East Asia in both their metadata and their timeseries, so that is the repo's de facto spelling and the IEA metadata is the outlier.

IEA-APS-2024    metadata regions : [..., 'Asia Pacific', 'Southeast Asia']
                timeseries geos  : ['Global', 'South East Asia']
                in timeseries but not declared: ['South East Asia']

IEA-STEPS-2024  (same)

ACE-*           metadata regions : ['South East Asia']
                timeseries geos  : ['South East Asia']          ✓ consistent

Why it matters

The detail page's new geography selector offers the tokens the metadata declares, and the plots resolve those against the geographies present in the timeseries. So on these two pathways:

  • selecting Southeast Asia cannot match the timeseries, so resolveGeography falls back to Global and the plot reports "No timeseries data for Southeast Asia; showing Global instead."
  • the regional series is right there in the file, under the other spelling, and is unreachable from the ribbon.

These are the only two multi-geography pathways currently loadable (the other 49 files are still schema v1 and skipped), so this is exactly where the selector looks broken.

There is a second, subtler consequence: Southeast Asia is a key of FILTER_REGIONS (src/utils/filterRegions.ts) while South East Asia is not. So the two spellings already behave differently in search, which is what commit 34e975a ("match keyFeature geography scopes by overlap, not containment") had to work around.

Suggested fix

  1. Rename the geography.regions key to South East Asia in src/data/iea/IEA-APS-2024.json and src/data/iea/IEA-STEPS-2024.json, matching their own timeseries and the ACE pathways.
  2. Add the guard that would have caught this: a data-integrity check asserting that every distinct geography in a *_timeseries.json is a token of flattenGeography() of its pathway's metadata. scripts/build-timeseries-files.ts already computes that distinct set, so the check is cheap. No such cross-check exists today — npm run schema:check validates each file against its schema but never compares the pair.

Worth deciding as part of (1) whether the canonical spelling should be the publication's own or the filter vocabulary's, since the two disagree here and region labels are deliberately free-form per publication.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions