Skip to content

feat: refresh DAC1 indicator catalogue + fix generator bug (2.7.0)#161

Merged
jm-rivera merged 1 commit into
mainfrom
feat/dac1-catalog-refresh
Jun 15, 2026
Merged

feat: refresh DAC1 indicator catalogue + fix generator bug (2.7.0)#161
jm-rivera merged 1 commit into
mainfrom
feat/dac1-catalog-refresh

Conversation

@jm-rivera

Copy link
Copy Markdown
Collaborator

Refreshes the DAC1 indicator catalogue to match the current OECD DAC1 flow-type classification, and fixes the bug that made the DAC1 indicator generator unrunnable.

Why

dac1_aid_flow_type_mapping() read a non-existent flow_type key (the JSON has flowtype_code), so it raised KeyError and the DAC1 generator couldn't run — the committed catalogue had drifted from dac1_aid_flow_types.json. This regenerates it from that (authoritative) source.

What changed

Catalogue (dac1_indicators.json + oda_data_indicators.csv): 17 indicator codes change their flow-type segment (same underlying data), 2 genuinely new indicators, 0 removed, 0 content-modified. Non-DAC1 catalogues and the hand-curated ONE.* block are untouched.

Old code New code
DAC1.50.5 DAC1.5.5
DAC1.37.415 DAC1.30.415
DAC1.50.420 DAC1.30.420
DAC1.50.425 DAC1.30.425
DAC1.50.3300 DAC1.37.3300
DAC1.50.3320 DAC1.37.3320
DAC1.50.3530 DAC1.37.3530
DAC1.50.359 DAC1.37.359
DAC1.50.3840 DAC1.37.3840
DAC1.50.3860 DAC1.37.3860
DAC1.50.3890 DAC1.37.3890
DAC1.50.7530 DAC1.37.7530
DAC1.10.11002 DAC1.40.11002
DAC1.50.2231 DAC1.1021.2231
DAC1.50.2232 DAC1.1021.2232
DAC1.50.2233 DAC1.1021.2233
DAC1.50.2234 DAC1.1021.2234

New: DAC1.10.1623 (Debt buybacks), DAC1.37.1030 (Offsetting entry for debt relief — private claims, principal).

Code/data:

  • dac1_aid_flow_type_mapping(): v["flow_type"]v["flowtype_code"]; dropped the redundant int(flow) cast in the generator.
  • flow_types.json: added flow types 5 ("Total official and private flows") and 1021 ("Memo items (mobilisation and blended finance)").
  • New tests/unit/indicators/test_dac1_oecd.py (28 tests) — the generator/loaders were previously 0% covered.
  • Version 2.6.02.7.0; CHANGELOG + docs updated with the full mapping.

Notes

  • No code/test/docs reference any of the renamed codes (only the catalogues do).
  • Minor release per maintainer decision — indicator codes are addressing strings, not Python API.
  • The two new flow-type display names were chosen with the maintainer.

All 543 tests pass; ruff/ty/pre-commit green.

Regenerate the DAC1 indicator catalogue from the current OECD DAC1
flow-type classification in dac1_aid_flow_types.json.

- Fix dac1_aid_flow_type_mapping(): read `flowtype_code` (the actual JSON
  key) instead of the non-existent `flow_type` — this KeyError had made the
  DAC1 indicator generator unrunnable. Drop the now-redundant int(flow) cast.
- Add flow types 5 ("Total official and private flows") and 1021
  ("Memo items (mobilisation and blended finance)") to flow_types.json.
- Regenerate dac1_indicators.json and oda_data_indicators.csv: 17 indicator
  codes change flow-type segment (same data), 2 new indicators added
  (DAC1.10.1623 Debt buybacks, DAC1.37.1030 offsetting entry for debt relief).
  No indicators removed; non-DAC1 catalogues untouched.
- Add tests/unit/indicators/test_dac1_oecd.py (28 tests) covering the
  generator and mapping loaders (previously 0% coverage).
- Bump version 2.6.0 -> 2.7.0; document the code changes + migration in
  CHANGELOG.md and docs.

All 543 tests pass; ruff/ty/pre-commit green.
@jm-rivera jm-rivera merged commit 5d30675 into main Jun 15, 2026
7 checks passed
@jm-rivera jm-rivera deleted the feat/dac1-catalog-refresh branch June 15, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant