Skip to content

Conversation

@seangtkelley
Copy link

@seangtkelley seangtkelley commented Apr 4, 2025

Pull request

This PR updates MAGICC7.ipynb using experience from #341.

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Example added (either to an existing notebook or as a new notebook, where applicable)
  • Description in CHANGELOG.rst added

Adding to CHANGELOG.rst

Please add a single line in the changelog notes similar to one of the following:

- (`#XX <http://link-to-pr.com>`_) Added feature which does something
- (`#XX <http://link-to-pr.com>`_) Fixed bug identified in (`#XX <http://link-to-issue.com>`_)

@seangtkelley seangtkelley marked this pull request as ready for review April 10, 2025 15:10
],
"source": [
"# NBVAL_SKIP\n",
"scenario_names = list(map(str.lower, scenarios.rcps.meta[\"scenario\"].unique()))\n",
Copy link
Author

Choose a reason for hiding this comment

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

scenarios.items() no longer exists so I've used this method to obtain all the available rcps.

"name": "stderr",
"output_type": "stream",
"text": [
"/Users/seangtkelley/miniconda3/envs/climate-model-pymagicc/lib/python3.10/site-packages/pymagicc/io/scen7.py:43: UserWarning: MAGICC6 RCP region naming (R5*) is not compatible with MAGICC7, automatically renaming to MAGICC7 compatible regions (R5.2*)\n",
Copy link
Author

Choose a reason for hiding this comment

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

Is there a way to avoid this warning?

@@ -158,7 +287,8 @@
"# NBVAL_SKIP\n",
"results.filter(variable=\"Surface Temperature\", region=\"World\").line_plot(\n",
" x=\"time\"\n",
");"
");\n",
"plt.show()"
Copy link
Author

Choose a reason for hiding this comment

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

Had to add this otherwise the plot does not appear.

" warnings.warn(warn_msg)\n",
"/Users/seangtkelley/miniconda3/envs/climate-model-pymagicc/lib/python3.10/site-packages/pymagicc/io/scen7.py:43: UserWarning: MAGICC6 RCP region naming (R5*) is not compatible with MAGICC7, automatically renaming to MAGICC7 compatible regions (R5.2*)\n",
" warnings.warn(warn_msg)\n",
"/Users/seangtkelley/miniconda3/envs/climate-model-pymagicc/lib/python3.10/site-packages/pymagicc/core.py:436: UserWarning: magicc logged a ERROR message. Check the 'stderr' key of the result's `metadata` attribute.\n",
Copy link
Author

Choose a reason for hiding this comment

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

The error message is as follows. Any ideas? Should it be recommended to turn off these gases in the .CFG file?

[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for C3F8
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for C4F10
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for C5F12
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for C7F16
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for C8F18
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CC4F8
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HFC152A
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HFC236FA
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HFC365MFC
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for NF3
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for SO2F2
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CFC11
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CFC12
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CFC113
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CFC114
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CFC115
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HCFC22
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HCFC141B
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HCFC142B
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CH3CCL3
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CCL4
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CH3CL
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CH2CL2
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CHCL3
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for CH3BR
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HALON1211
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HALON1301
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HALON2402
[Apr 10 2025 16:02:51][rawscen_to_hist] <ERROR> raw emis data does not exist for HALON1202
[Apr 10 2025 16:02:51][dumpoutput] <WARNING> OUT_KEYDATA_2 is deprecated. Use OUT_DYNAMIC_VARS instead

"running RCP60\n",
"running RCP85\n"
"ename": "ValueError",
"evalue": "You have more than one `FILE_EMISSCEN_X` flag set. Using more than one emissions scenario is hard to debug and unnecessary with Pymagicc's Dataframe scenario input. Please combine all your scenarios into one Dataframe with Pymagicc and Pandas, then feed this single Dataframe into Pymagicc's run API.",
Copy link
Author

Choose a reason for hiding this comment

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

I cannot get passed this error using a .CFG file identical to the one above. I've also tried removing references to FILE_EMISSCEN_X and I get the same error. Any ideas?

"outputs": [
{
"ename": "ImportError",
"evalue": "cannot import name 'reshape_line_plot' from 'pyam.plotting' (/Users/seangtkelley/miniconda3/envs/climate-model-pymagicc/lib/python3.10/site-packages/pyam/plotting.py)",
Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure what version of pyam-iamc was used in the original run of the notebook, but this function no longer exists and I can't find an equivalent.

@seangtkelley seangtkelley changed the title Magicc7 Notebook Updates WIP Magicc7 Notebook Updates Apr 13, 2025
@seangtkelley seangtkelley changed the title WIP Magicc7 Notebook Updates WIP: Magicc7 Notebook Updates Apr 13, 2025
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.

1 participant