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

GHG Accounting #391

Merged
merged 5 commits into from
Aug 26, 2021
Merged

GHG Accounting #391

merged 5 commits into from
Aug 26, 2021

Conversation

krcolbert
Copy link
Contributor

Hello,

This push request is for updating the Project Drawdown Solutions model for the purpose of developing the greenhouse gas accounting method.

(1) Updated the greenhouse gas accounting method for the CO2 and CH4 modules. This way we can show results in both individual gas units and CO2-equivalent units.
(2) Introduced a module for N2O.
(3) Updated the Global Warming Potential (GWP) conversions in the emission factors.
(4) Included a tutorial for how to use the new features with example solutions Improved Rice and Landfill Methane.

Warm regards,
Kristina Colbert

(1) Updated the greenhouse gas accounting method for CO2 and CH4. This way we can show results in both individual gas units and CO2-equivalent units. (2) Introduced a module for N2O. (3) Updated the Global Warming Potential (GWP) conversions in the emission factors. (4) Included a tutorial for how to use the new features with example solutions Improved Rice and Landfill Methane.

- Kristina Colbert
@denised
Copy link
Member

denised commented Aug 12, 2021

@krcolbert

I was unable to load the improvedrice scenario due to the undefined self.no2 reference I mentioned in the comments. Did it work for you?

Otherwise, I am pretty happy with what I see. The main thing that has not been addressed is testing. There are actually two parts to this: adding some unit tests for the new code (to the models/tests directory) and removing some of the existing tests of the solutions that will now break because the numbers they return are different. The second one I will take care of once we have the scenarios implemented and working. But I would appreciate it if you could create a test case or two for the new functionality --- I hope the existing tests are a reasonable guide, let me know if they aren't.

Other than that, please fix the scenario initialization, and add the initialization for the other affected scenarios.

I put a lot of comments in your wonderful documentation file --- I would like to see this better integrated into the rest of the code, but it is a much lower priority for getting this project accepted.

Thank you!

solution/improvedrice/__init__.py Show resolved Hide resolved
solution/landfillmethane/__init__.py Show resolved Hide resolved
KC_ghg_tutorial.py Outdated Show resolved Hide resolved
KC_ghg_tutorial.py Outdated Show resolved Hide resolved
KC_ghg_tutorial.py Outdated Show resolved Hide resolved
KC_ghg_tutorial.py Outdated Show resolved Hide resolved
KC_ghg_tutorial.py Outdated Show resolved Hide resolved
KC_ghg_tutorial.py Outdated Show resolved Hide resolved
Fixed the undefined self.n2o reference. It was out of order and needed to be placed above the CO2 functionality for the improved rice solution. And N2O is not a gas used in the landfill solution, so I removed all references to N2O there.
@krcolbert
Copy link
Contributor Author

Hi Denise,

Thank you for taking a look over the code and trying to run it. I did also end up having the same error as you about the N2O in the init.py. That was a mistake on my part. It is now corrected and the tutorial script will run for me. I think you have access to the second commit. Not sure how that all works - but let me know if you can't see it and we'll try to get it on here.

In the next commit, I will add the remaining multi-gas solutions. The current commit, only has edits to the improved rice and landfill methane solutions as two test examples. I can also put together a Jupiter Notebook for easier tutorial and test capabilities.

Many thanks for you comments!
Kristina

@denised
Copy link
Member

denised commented Aug 19, 2021 via email

(1) Added jupyter notebook tutorials for how to run the new greenhouse gas accounting features and climate modeling.
(2) Included a few features into the Start_Here jupyter notebook for new functionality.
(3) Made a test notebook for the thirteen multi-gas solutions.
(4) Changes to the init.py files for the new ghg accounting functions.
@krcolbert
Copy link
Contributor Author

Hi Denise,

I've got a lot here that's been updated. And I'm pretty sure it will be ready to be merged. Everything is working on my end.

To give you a brief overview, I've added three Jupyter notebooks:
1.) Tutorial_Climate_Modeling
2.) Tutorial_GHG_Accounting
3.) Test_Multigas_Solutions

I also added some functionality to the Start_Here like we talked about doing.

And, there are several init.py files that are changed for the multi-gas solutions. You can test that they are all working with the Jupyter notebook called Test_Multigas_Solutions.

Let me know if you see anything that's not working out.
Kristina

@denised
Copy link
Member

denised commented Aug 23, 2021

@krcolbert This looks great! I'm happy you did the documentation as well. I've asked for signoff from Project Drawdown to accept this change into code base.

@denised denised mentioned this pull request Aug 24, 2021
@denised denised merged commit 9275509 into ProjectDrawdown:develop Aug 26, 2021
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.

None yet

2 participants