Skip to content

Commit a40ec8d

Browse files
authored
Notebooks updated for compatibility with new ConfigManager class
2 parents 9042e31 + 0e5275e commit a40ec8d

File tree

8 files changed

+277
-385
lines changed

8 files changed

+277
-385
lines changed

advanced_test.ipynb

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.

advanced_test_tw.ipynb

Lines changed: 115 additions & 224 deletions
Large diffs are not rendered by default.

analyze_mcmc.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 1,
25+
"execution_count": null,
2626
"metadata": {},
2727
"outputs": [],
2828
"source": [
@@ -36,12 +36,12 @@
3636
"from scipy.stats import norm, gamma, truncnorm, gaussian_kde\n",
3737
"from scipy.stats import gaussian_kde\n",
3838
"# pygem imports\n",
39-
"import pygem.setup.config as config\n",
40-
"# check for config\n",
41-
"config.ensure_config()\n",
39+
"from pygem.setup.config import ConfigManager\n",
40+
"# instantiate ConfigManager\n",
41+
"config_manager = ConfigManager()\n",
4242
"# read the config\n",
43-
"pygem_prms = config.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
44-
" # the appropriate location. If any errors occur, check this first.\n",
43+
"pygem_prms = config_manager.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
44+
" # the appropriate location. If any errors occur, check this first.\n",
4545
"# set some plotting defaults\n",
4646
"plt.rcParams[\"font.family\"] = \"arial\"\n",
4747
"plt.rcParams['font.size'] = 10\n",

analyze_mcmc_regional.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
{
5555
"cell_type": "code",
56-
"execution_count": 1,
56+
"execution_count": null,
5757
"id": "5d6d5f58",
5858
"metadata": {},
5959
"outputs": [],
@@ -68,12 +68,12 @@
6868
"import xarray as xr\n",
6969
"import matplotlib.image as mpimg\n",
7070
"# pygem imports\n",
71-
"import pygem.setup.config as config\n",
72-
"# check for config\n",
73-
"config.ensure_config()\n",
71+
"from pygem.setup.config import ConfigManager\n",
72+
"# instantiate ConfigManager\n",
73+
"config_manager = ConfigManager()\n",
7474
"# read the config\n",
75-
"pygem_prms = config.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
76-
" # the appropriate location. If any errors occur, check this first.\n",
75+
"pygem_prms = config_manager.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
76+
" # the appropriate location. If any errors occur, check this first.\n",
7777
"import pygem.pygem_modelsetup as modelsetup\n",
7878
"from pygem import mcmc\n",
7979
"from pygem.shop import oib\n",

analyze_regional_change.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@
3636
},
3737
{
3838
"cell_type": "code",
39-
"execution_count": 1,
39+
"execution_count": null,
4040
"metadata": {},
4141
"outputs": [],
4242
"source": [
4343
"### imports ###\n",
4444
"import os, sys, glob\n",
4545
"# pygem imports\n",
4646
"import pygem.pygem_modelsetup as modelsetup\n",
47-
"import pygem.setup.config as config\n",
48-
"# check for config\n",
49-
"config.ensure_config()\n",
47+
"from pygem.setup.config import ConfigManager\n",
48+
"# instantiate ConfigManager\n",
49+
"config_manager = ConfigManager()\n",
5050
"# read the config\n",
51-
"pygem_prms = config.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
52-
" # the appropriate location. If any errors occur, check this first."
51+
"pygem_prms = config_manager.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
52+
" # the appropriate location. If any errors occur, check this first."
5353
]
5454
},
5555
{

run_calibration.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
"### imports ###\n",
4141
"import os, sys, glob, json\n",
4242
"# pygem imports\n",
43-
"import pygem.setup.config as config\n",
44-
"# check for config\n",
45-
"config.ensure_config()\n",
43+
"from pygem.setup.config import ConfigManager\n",
44+
"# instantiate ConfigManager\n",
45+
"config_manager = ConfigManager()\n",
4646
"# read the config\n",
47-
"pygem_prms = config.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
48-
" # the appropriate location. If any errors occur, check this first.\n",
47+
"pygem_prms = config_manager.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
48+
" # the appropriate location. If any errors occur, check this first.\n",
4949
"rootpath=pygem_prms['root']"
5050
]
5151
},

run_simulation.ipynb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@
3636
"### imports ###\n",
3737
"import os, sys, glob, json\n",
3838
"# pygem imports\n",
39-
"import pygem.setup.config as config\n",
40-
"\n",
41-
"# check for config\n",
42-
"config.ensure_config()\n",
39+
"from pygem.setup.config import ConfigManager\n",
40+
"# instantiate ConfigManager\n",
41+
"config_manager = ConfigManager()\n",
4342
"# read the config\n",
44-
"pygem_prms = config.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
45-
" # the appropriate location. If any errors occur, check this first.\n",
43+
"pygem_prms = config_manager.read_config() # NOTE: ensure that your root path in ~/PyGEM/config.yaml points to\n",
44+
" # the appropriate location. If any errors occur, check this first.\n",
4645
"rootpath=pygem_prms['root']"
4746
]
4847
},

0 commit comments

Comments
 (0)