Implement currency data update workflow#61
Open
Wegatriespython wants to merge 5 commits intoIAMconsortium:mainfrom
Open
Implement currency data update workflow#61Wegatriespython wants to merge 5 commits intoIAMconsortium:mainfrom
Wegatriespython wants to merge 5 commits intoIAMconsortium:mainfrom
Conversation
Contributor
|
From the description this is great, thanks for the contribution! One knee-jerk question prior to a real review: the 25 added data files each have 1 data point in them. Did you consider / would it be worse/better to follow an approach similar to the generation of emissions.py? IOW, generate a Python source file containing a data structure with all relevant data. This could be more compact. |
|
wow @Wegatriespython didn't expect you to address this within 2 hours. Thank you so much! ;) |
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.
This replaces the stubbed
iam_units.update.currency()with a working generator and expands currency support from one hardcoded entry (EXC, EUR, 2005) to all five OECD Table 4 methods (EXC,EXCE,PPPGDP,PPPPRC,PPPP41) across five periods (2005, 2010, 2015, 2020, 2024) for EUR. This partly addresses #25.The original stub in
update.pyspecified three requirements for an implementation:sdmx1to query either the World Bank or OECD SDMX API.iam_units/data/currency/, one file per (method, period).The inline NB comments in
currency.pynoted two extensions: loading from file instead of embedded constants, and extending to cover other currencies. This PR addresses the first; EUR remains the only non-USD currency.The current PR:
currency()in the update submodule usingsdmx1to query OECD Table 4 (DSD_NAMAIN10@DF_TABLE4), following the pattern established for emissions data.iam_units/data/currency/, committed as package data and loaded at runtime without any dependency onsdmx1.configure_currency()against silent wrong answers when called twice with different methods for the same currency/period pair — now raisesValueError. Same-method calls are idempotent.DEVELOPING.rstand the expanded capabilities in the README.EUR rows are derived from the DEU series in Table 4. For exchange rates this is exact; for PPP methods the values are Germany-specific. This follows the approach in #60 which switched EUR deflators to Eurozone-wide values, but PPP is inherently country-level — the choice is documented in code and
DEVELOPING.rst.