Skip to content
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

📊 Update dataset on national contributions to climate change #2496

Conversation

pabloarosado
Copy link
Contributor

Update dataset on national contributions to global warming (Jones et al.).

@pabloarosado pabloarosado self-assigned this Apr 8, 2024
Copy link
Contributor

@paarriagadap paarriagadap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good! I think I remember seeing a previous version of this. I added a few minor comments, but it's all working good.

dag/emissions.yml Show resolved Hide resolved
name: CC BY 4.0
url: https://zenodo.org/record/7636699#.ZFCy4exBweZ
wdir: ../../../data/snapshots/emissions/2023-11-23
Jones, M. W. (2024) “National contributions to climate change due to historical emissions of carbon dioxide, methane and nitrous oxide”, Scientific Data. Zenodo. doi: 10.5281/zenodo.10839859.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One problem with the automatic extraction of the text is that it uses an APA-like kind of format we are moving away from

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They offer different choices. I changed APA to Chicago style.

"Ryukyu Islands": "Ryukyu Islands",
"St. Kitts-Nevis-Anguilla": "St. Kitts-Nevis-Anguilla",
"LDC": "Least developed countries (Jones et al.)",
"OECD": "OECD (Jones et al.)"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why Pacific Islands (Palau) is not here, but in the excluded list, when there are several such entities in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was overlapping data for "Palau" and for "Pacific Islands (Palau)", so I simply excluded this region instead of trying to figure out a better solution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: On line 271, it seems redundant to use the maps_series functions when you run run_sanity_checks_on_inputs just before. I think replace can do the job just as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, warnings for the harmonizing countries function are True by default, so there's no need to keep the parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, map_series warns if something can't be mapped, while replace silently creates nan.

####################################################################################################################
for column in columns_that_cannot_be_negative:
# Ensure all negative values are just numerical noise.
assert (tb[column].fillna(0) >= -2e-4).all()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set the tolerance value above and call it here to easily change it if needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I preferred to have this value here, close to where it's most relevant, given that it's just a very specific check. That value is not an important global variable that is used elsewhere or that affects the data.

assert emissions_after_jump / emissions_before_jump > 10, error

# Visually inspect the jump.
# import plotly.express as px
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this code if you're not using it anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's convenient to have it there, as a quick way to check on next update if the spurious jump is still in the data.

@@ -39,173 +39,237 @@ tables:
unit: tonnes
short_unit: t
description_short: *measured-in-tonnes
presentation:
title_public: Annual methane emissions from fossil fuels and industry
annual_emissions_ch4_land:
title: Annual methane emissions from agriculture and land use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it could be useful to explain what land use includes in description_short

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be even better to have a DoD about land use emissions, I'll write that down.

@@ -214,16 +278,22 @@ tables:
description_key:
- This temperature change measures each country's contribution to global mean surface temperature (GMST) rise from its cumulative emissions of carbon dioxide, methane and nitrous oxide.
- The warming effects of each gas are calculated based on cumulative CO₂-equivalent emissions using the Global Warming Potential (GWP*) approach.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could maybe expand on what Global Warming Potential (GWP*) approach is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a DoD for GWP. I suppose it could be better to add a sentence or a paragraph about GWP* there.

@pabloarosado
Copy link
Contributor Author

Thank you very much for the review, @paarriagadap!

@pabloarosado pabloarosado merged commit 11642b0 into update-national-contributions-data-reference-branch Apr 9, 2024
8 of 9 checks passed
@pabloarosado pabloarosado deleted the update-national-contributions-data branch April 9, 2024 08:24
pabloarosado added a commit that referenced this pull request Apr 10, 2024
…e branch (#2501)

* Duplicate code from previous version of national contributions to global warming dataset

* Update dataset on national contributions to climate change (#2496)

* Adapt snapshots, meadow, garden and grapher steps

* Fix spurious negative numbers

* Improve format

* Various small improvements, following Pablo A suggestions
@pabloarosado pabloarosado changed the title Update dataset on national contributions to climate change 📊 Update dataset on national contributions to climate change Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants