-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix naming of GDP and population columns in SSP data aggregation within tools.costs
#219
Conversation
I don't recall precisely, but I would guess that I put the If that's since changed, and they're no longer needed, a better fix would be to remove them and the associated code entirely. |
Thanks Paul -- I am using the all of the columns in the output of |
Okay, then good to keep them. In that case I'd instead ask to expand the docs with half a sentence for these two columns, explaining precisely what is contained in each, so that others can maybe use them in the same way. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #219 +/- ##
=======================================
- Coverage 58.8% 58.8% -0.1%
=======================================
Files 194 194
Lines 15159 15161 +2
=======================================
Hits 8922 8922
- Misses 6237 6239 +2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why the .tools.wb
cherry-picked changes are apparently not covered by the tests, since the corresponding tests do seem to run (although XFAIL).
However, LGTM and then continue with other work/clean-up, e.g. in #213 from which those changes were cherry-picked.
Small fix to
total_gdp
andtotal_population
columns being switched inmessage_ix_models.tools.costs.gdp.process_raw_ssp_data()
In the
message_ix_models.tools.costs.gdp.process_raw_ssp_data()
function that pulls and combines SSP data intools.costs
, there is a block of code that converts the data in theComputer()
into apandas
DataFrame, with each computer key being a column. However, the naming of the columns are switched (total_population
andtotal_gdp
). So, I just swapped them.From what I can tell, this has zero impact on the actual costs calculations, as these DataFrames columns are not used anywhere (and are later even dropped). The calculation of GDP per capita happens before this DataFrame is created, here:
message-ix-models/message_ix_models/tools/costs/gdp.py
Lines 87 to 88 in 9bb0037
And these values seem to be correct.
I picked up on this because I am calling using the output of
message_ix_models.tools.costs.gdp.process_raw_ssp_data()
function on its own elsewhere.How to review
For @khaeru and/or @glatterf42 : Read the diff and note that the CI checks all pass.
PR checklist