feat: refresh DAC1 indicator catalogue + fix generator bug (2.7.0)#161
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-existentflow_typekey (the JSON hasflowtype_code), so it raisedKeyErrorand the DAC1 generator couldn't run — the committed catalogue had drifted fromdac1_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-curatedONE.*block are untouched.DAC1.50.5DAC1.5.5DAC1.37.415DAC1.30.415DAC1.50.420DAC1.30.420DAC1.50.425DAC1.30.425DAC1.50.3300DAC1.37.3300DAC1.50.3320DAC1.37.3320DAC1.50.3530DAC1.37.3530DAC1.50.359DAC1.37.359DAC1.50.3840DAC1.37.3840DAC1.50.3860DAC1.37.3860DAC1.50.3890DAC1.37.3890DAC1.50.7530DAC1.37.7530DAC1.10.11002DAC1.40.11002DAC1.50.2231DAC1.1021.2231DAC1.50.2232DAC1.1021.2232DAC1.50.2233DAC1.1021.2233DAC1.50.2234DAC1.1021.2234New:
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 redundantint(flow)cast in the generator.flow_types.json: added flow types5("Total official and private flows") and1021("Memo items (mobilisation and blended finance)").tests/unit/indicators/test_dac1_oecd.py(28 tests) — the generator/loaders were previously 0% covered.2.6.0→2.7.0; CHANGELOG + docs updated with the full mapping.Notes
All 543 tests pass; ruff/ty/pre-commit green.