Repository navigation
refactor: drop the geography spelling folds #945 needed - #980
Conversation
Timeseries now carry the metadata's own geography labels, and validateTimeseries enforces it (#974), so three workarounds for "South East Asia" vs "Southeast Asia" are no longer needed: - resolveGeography's labelVariant arm - regionMemberCodes' fallback to canonicalGeographyKey - hasGeography's label and spelling-fold attempts; it is now a plain lookup of the metadata token canonicalGeographyKey stays: comparisonScope uses it to spot two publishers using one region name with different members, which is a cross-publication question, not a data mismatch. The tests for the removed behaviour now assert the new contract: a different spelling is a different geography. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Expected version change and release notes🚨 WARNING: This PR is not expected to trigger a new versionTo trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/ |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-980.westus2.2.azurestaticapps.net |
…fold Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Expected version change and release notes🚨 WARNING: This PR is not expected to trigger a new versionTo trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/ |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-980.westus2.2.azurestaticapps.net |
…fold Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Expected version change and release notes🚨 WARNING: This PR is not expected to trigger a new versionTo trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/ |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-980.westus2.2.azurestaticapps.net |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused refactor aligns callers with the enforced timeseries metadata contract and updates relevant tests consistently.
Review effort: Balanced
Findings: None
What changed in this PR
Removes obsolete geography spelling-fold workarounds now that timeseries labels must match pathway metadata exactly.
Changes:
- Uses exact normalized tokens for timeseries availability and geography resolution.
- Removes cross-spelling region-member matching.
- Updates tests and documentation for the stricter contract.
| File | Description |
|---|---|
src/utils/timeseriesAvailability.ts |
Simplifies geography availability lookup. |
src/utils/timeseriesAvailability.test.ts |
Tests exact token matching. |
src/utils/geographyUtils.ts |
Removes region spelling fallback. |
src/utils/geographyUtils.test.tsx |
Updates region matching expectations. |
src/utils/geographyFallback.ts |
Removes label-variant resolution. |
src/utils/geographyFallback.test.ts |
Tests exact matching and reported fallback. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Closes #945. Stacked on #974, which makes timeseries geography labels match the metadata exactly and enforces it in
schema:check. Independent of #975, #976 and #979.With the labels guaranteed equal, three workarounds for "South East Asia" vs "Southeast Asia" go:
resolveGeography: thelabelVariantarm. A different spelling is now a different geography; if that ever happened it would be a visible, reported fallback.regionMemberCodes: thecanonicalGeographyKeyfallback (added in Feat/comparison scope #954 as a stopgap).pathwayToolAvailability().hasGeography: the label and spelling-fold attempts. It is now a plain lookup of the metadata token.Kept on purpose:
canonicalGeographyKeyitself.comparisonScopeuses it to notice when two publishers use one region name with different members. That's a question across publications, not a data mismatch.comparisonScope.test.tsfixtures with IEA "Southeast Asia" next to ACE "South East Asia" model that same cross-publisher case, so they stay. My comment on Data: IEA pathways spell the same region two ways across metadata and timeseries #945 listed them for removal; that was wrong.Checked:
ASEAN), IEA (Southeast Asia) and JRC (South East Asia) still plot their regional series with no fallback note.🤖 Generated with Claude Code