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

Release management / pyhector #202

Closed
rgieseke opened this issue Oct 19, 2017 · 6 comments
Closed

Release management / pyhector #202

rgieseke opened this issue Oct 19, 2017 · 6 comments

Comments

@rgieseke
Copy link
Contributor

Hi,

I had a look at what difference the changes from #201 make (similar to earlier plots in issue #186):

rcps

This makes it seem worth updating Pyhector soon.
I could apply the patch like I did here for testing, but I'm wondering if you plan to apply this to the RC1.2 branch as well? Or if you have any plans to make releases more frequent. Ideally, we could target the current release with Pyhector.

Code I used below:

pyhector installed from git clone

pip install -e .
pymagicc from pip
pip install pymagicc
import matplotlib.pyplot as plt
import pandas as pd
plt.style.use("ggplot")

import pyhector
import pymagicc


def relative_temp_1850_1900(temp):
    return temp.loc[1850:] - temp.loc[1850:1900].mean()

hector_options = {"core": {"endDate": 2100}}

magicc_temps = {}
for name, scen in pymagicc.scenarios.items():
    temp = pymagicc.run(scen)
    magicc_temps[name] = relative_temp_1850_1900(temp["SURFACE_TEMP"].GLOBAL)

magicc_temps = pd.DataFrame(magicc_temps)
magicc_temps.to_csv("magicc_temps.csv")

hector_temps = {}
hector_scens = {
    'RCP3PD': pyhector.rcp26,
    'RCP45': pyhector.rcp45,
    'RCP6': pyhector.rcp60,
    'RCP85': pyhector.rcp85
}
for name, scen in hector_scens.items():
    temp = pyhector.run(scen, hector_options)
    hector_temps[name] = relative_temp_1850_1900(temp["temperature.Tgav"])
hector_temps = pd.DataFrame(hector_temps)
hector_temps.to_csv("hector_temps.csv")

pyhector installed from git clone and patched with #201

cd hector-wrapper/hector
wget https://github.com/JGCRI/hector/pull/201.patch
git apply 201.patch 
cd ../..
pip install -e .
import pyhector

def relative_temp_1850_1900(temp):
    return temp.loc[1850:] - temp.loc[1850:1900].mean()

hector_options = {"core": {"endDate": 2100}}

hector_halofix_temps = {}
hector_scens = {
    'RCP3PD': pyhector.rcp26,
    'RCP45': pyhector.rcp45,
    'RCP6': pyhector.rcp60,
    'RCP85': pyhector.rcp85
}
for name, scen in hector_scens.items():
    temp = pyhector.run(scen, hector_options)
    hector_halofix_temps[name] = relative_temp_1850_1900(temp["temperature.Tgav"])
hector_halofix_temps = pd.DataFrame(hector_halofix_temps)

magicc_temps = pd.read_csv("magicc_temps.csv", index_col=0)
hector_temps = pd.read_csv("hector_temps.csv", index_col=0)

for idx, name in enumerate(hector_scens.keys()):
    plt.subplot(2, 2, idx + 1)
    plt.title(name)
    magicc_temps[name].plot(label="Magicc", style="--", color="darkgray")
    hector_temps[name].plot(label="Hector")
    hector_halofix_temps[name].plot(label="Hector Halofix")
    plt.legend()
plt.suptitle("Global mean temp. (°C) rel. to 1850-1900 mean")
plt.savefig("rcps.png")
@cahartin
Copy link
Contributor

Hi @rgieseke. We have a developmental branch <dev_doeclim> that I am currently working on merging into master. It incorporates a 1-D ocean diffusion model to better represent the oceanic heat uptake. This would be a major release for Hector. Like you mentioned we could time the release of pyhector with a new release of Hector.

@rgieseke
Copy link
Contributor Author

I thought it would be good if a patch like this were "released" faster, so "1.1.5". Are you planning on doing a 1.2 and a 2.0 release? Pyhector is currently based on the 1.2 branch ...

@cahartin
Copy link
Contributor

@rgieseke I wanted to fill you in on our plan over the next 2 months. We will have a v1.2 that will incorporate a few issues and an old PR from you guys (We apologize for letting that one hang on for so long). After that we will have a v2.0 release which will have a significant update to the ocean heat uptake structure (currently a PR, working on some code cleanup).

@rgieseke
Copy link
Contributor Author

Many thanks for the update and apologies if I've been nagging too much! If there is anything I or @swillner can do to improve the PR or help testing let us know.
Just to understand the context for the different branches, is 1.2 needed to keep compatibility with other projects like GCAM? With Pyhector we could also just move on to 2.0 ...

@bpbond
Copy link
Member

bpbond commented Nov 30, 2017

Please no apologies! And yes, @swillner I'm sorry for your long-neglected #173 - we'll get that taken care of soon.

@rgieseke
Copy link
Contributor Author

rgieseke commented Jan 3, 2018

We've made a patch release for Pyhector (as 0.8.1) with the halo-fix

openclimatedata/pyhector#20

We'll have another release, once 1.2 or 2.0 are out!

Closing this now, discussion on releases and branches can probably continue in #210

@rgieseke rgieseke closed this as completed Jan 3, 2018
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

No branches or pull requests

3 participants