Update macro calibration: API-driven parameters, updated defaults, and documentation - #6
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6 +/- ##
=======================================
Coverage ? 86.60%
=======================================
Files ? 15
Lines ? 687
Branches ? 0
=======================================
Hits ? 595
Misses ? 92
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Port missing test modules from OG-ZAF, adapted for OG-BRA: - test_import_smoke: basic package import sanity check - test_calibrate: offline/online mode and partial-failure behavior for the Calibration class (all API calls monkeypatched) - test_update_baseline: verifies main() writes a valid JSON that can be loaded into OG-Core Specifications without errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
This PR updates OG-BRA's macro calibration to use direct API calls for parameter retrieval, refreshes the default parameter values from current data, and expands the calibration documentation.
Macro parameters (
macro_params.py/calibrate.py)macro_params.pyto use direct REST API calls (World Bank WDI/QPSD, IMF GFS, ILO ILOSTAT) instead ofpandas-datareader, following the OG-ZAF patternupdate_from_api=Falseflag toCalibration.__init__()so the class can be instantiated without triggering API calls (preserves current behavior by default)update_baseline.pyscript to programmatically refresh and writeogbra_default_parameters.jsonMakefilewithnew-baselinetarget andAGENTS.mddocumenting the workflowUpdated default parameter values (
ogbra_default_parameters.json)Key changes from running
make new-baselineagainst current API data:initial_debt_ratiog_y_annualgammaalpha_Talpha_Gcit_ratetau_ctau_payrollstart_yearg_n_ssDocumentation updates
macro.md: Updated all macro parameter values and data sources; fixed broken linksfirms.md: Updated capital share (γ) from 0.588 to 0.407 with ILO sourcegovernment.md: Updated α_G and α_T from IMF GFSdemographics.md: Updated population data vintage (2026) and cross-referencestaxes.md: Expanded from stub to full documentation covering:tau_payroll = 0.28)cit_rate = 0.34, IRPJ + CSLL)tau_c = 0.09, PIS + COFINS; context on CBS/IBS reform)exogenous_parameters.md: Replaced static hardcoded table with auto-generated{include}directivecreate_doc_figures.py: Refactored to useimportlib.resources, dynamicstart_year, andmain()wrapperDependencies
pandas-datareader,xlwt,linearmodelsfrompyproject.toml(no longer used after macro_params.py refactor)tests/test_macro_params.py) with monkeypatched unit tests (no live API calls)🤖 Generated with Claude Code