Function for downloading zenodo calibration#135
Merged
ameligrana merged 6 commits intobancaditalia:mainfrom Mar 10, 2026
Merged
Conversation
Also includes the utility function 'get_valid_calibration_quarters' that can be used to retrieve a list of all (YEAR, QUARTER) pairs for which this calibration object can be used.
Adds comprehensive unit tests for the integration between download_zenodo_calibration_object and get_params_and_initial_conditions. Tests cover basic functionality, data validation, error handling, and multi-country support.
Fixes compatibility issues between ITALY_CALIBRATION (old format) and Zenodo calibration (new format): 1. Fixed CartesianIndex extraction: findall() returns CartesianIndex objects that need to be converted to integers before use as array indices. 2. Fixed capital_consumption calculation: Zenodo format has pre-computed sectoral data, but ITALY_CALIBRATION requires runtime calculation from scalar inputs using the original formula: nace64_capital_consumption ./ nominal_nace64_output .* output 3. Fixed employers_social_contributions calculation: Handles both sectoral wages (Zenodo format) and scalar wages (ITALY_CALIBRATION format) by estimating sectoral contributions from scalar data when needed. These changes ensure backward compatibility with existing ITALY_CALIBRATION while maintaining support for the new Zenodo calibration format.
4a1b4d2 to
43f1fe2
Compare
Contributor
Author
|
@aldoglielmo @ameligrana reviewable now |
Collaborator
|
Very nice! It seems to work pretty well. I found some issues though when using with "LU" and "MT" with the code import BeforeIT as Bit
for country in Bit.AVAILABLE_COUNTRIES
try
co = Bit.download_zenodo_calibration_object(country)
parameters, initial_conditions = Bit.get_params_and_initial_conditions(co, Bit.DateTime(2020, 03, 31);
scale = 1 / 1000)
model = Bit.Model(parameters, initial_conditions)
Bit.step!(model)
catch e
println(country)
println(e)
end
endthe stepping throws with |
ameligrana
approved these changes
Mar 10, 2026
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.
Builds on PR #134
Usage: