Repository navigation
feat(prototypes): read the latest debt view entirely through the DFO - #152
Merged
Merged
Conversation
The 2025 view took China's official split, IMF repurchases after the base year, private service, lending terms and concessionality from the IDS bulk files, which the DFO holds as well. Sixteen more pinned readings now carry them, so the 2025 view downloads no bulk files and the DFO-against-bulk cross-check goes. The 2024 view still reads the archived December 2025 files, which the DFO no longer holds. Both sources share one release check, check_actuals in panel.py. The grant element in present_value is now weighted by each year's commitments: the bulk files report 0 in years without loans and the DFO leaves those years out, and the weighting treats both alike. No country changes group, and the 2024 rebuild still matches FDL for 54 of 58.
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.
The 2025 view of the debt-thresholds prototype now reads all its IDS data through the DFO. It previously took China's official split, IMF repurchases after the base year, private service, lending terms and concessionality from the World Bank's bulk files, although the DFO holds every one of them. The 2024 view still reads the archived December 2025 bulk files, since the DFO holds only the current release.
Changes
_data/pipeline/sources/pinned_specs.jsongains 16 readings, each found by its IDS code: disbursements by creditor and bilateral service, principal and disbursements by creditor (for China's part),DT.AMT.DIMF.CDwith the IMF as creditor (repurchases to 2031),DT.TDS.PRVT.CD, the eight terms series (DT.INR,DT.MAT,DT.GPA,DT.COM, official and private),DT.DOD.ALLC.CDandDT.GRE.DPPG.dfo_api.pymaps them throughDFO_KEYSandCHINA_KEYS;imf_flowsnow supplies only IMF disbursements.run.pyreads the 2025 view fromfetch_dfoalone.merge_panelsandcross_checkgo, along with the cross-check line incoverage.md.config.py: a view with noids_dirreads IDS through the DFO, anduse_dfois a property derived from it.release_dirgoes.panel.pyaddscheck_actuals, the release check both sources now run:check_releasefor the bulk files, andfetch_dfofor the DFO.valuation.pyweights each year's grant element by its commitments (DT.COM.OFFT.CDplusDT.COM.PRVT.CD).Notes for reviewers
imf_flowsreading stops its repurchases at 2025, which is whyDT.AMT.DIMF.CDis now pinned on its own. Private service was missing too, which made the creditor guard fail.debtPVslightly for 58 countries in each view but changes no group: 7, 20 and 31 in 2025, and 54 of 58 matching FDL on 2024 data.inputs.jsondata is unchanged. Its diff, and most ofthresholds.json's, is provenance for the 16 new readings.Testing:
uvx --with pytest pytest tests(81 passed), ruff,ty check,pnpm test(31 passed),pnpm typecheckandpnpm check:dataclean. Full data runs compared to the committed outputs at each step.