Skip to content

Commit 6f76b99

Browse files
committed
remove unnecessary imports and minor edits to some jupyter notebooks
1 parent d0bf988 commit 6f76b99

6 files changed

Lines changed: 20 additions & 65 deletions

notebooks/data_examples.ipynb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Example usage of `Data` class and `load_data_file` utility function to manage PRMS input\n",
7+
"# Example usage of `Data` class and `load_data_file` utility function to manage PRMS forcing input\n",
88
"\n",
99
"The `prms_python` module provides the `Data` class to facilitate management, modification, and visualization of the PRMS input data. `prms_python` also includes a simpler utility function `load_data_file` that returns the data file as a date-indexed Pandas Dataframe object. \n",
1010
"\n",
@@ -19,17 +19,14 @@
1919
"metadata": {},
2020
"outputs": [],
2121
"source": [
22-
"from __future__ import print_function\n",
23-
"import sys, os\n",
22+
"import os\n",
2423
"import numpy as np\n",
2524
"import matplotlib.pyplot as plt\n",
2625
"import matplotlib\n",
2726
"from prms_python.util import load_data_file\n",
2827
"from prms_python import Data\n",
2928
"matplotlib.style.use('ggplot')\n",
30-
"%matplotlib inline\n",
31-
"%load_ext autoreload\n",
32-
"%autoreload 2"
29+
"%matplotlib inline"
3330
]
3431
},
3532
{

notebooks/monte_carlo_optimization_result.ipynb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
"metadata": {},
2424
"outputs": [],
2525
"source": [
26-
"import sys\n",
27-
"sys.path.append('..')\n",
2826
"from prms_python import Data, Optimizer, Parameters, util\n",
2927
"from prms_python.optimizer import OptimizationResult\n",
3028
"import matplotlib.pyplot as plt\n",
@@ -33,8 +31,6 @@
3331
"import warnings; warnings.simplefilter('ignore')\n",
3432
"matplotlib.style.use('ggplot')\n",
3533
"%matplotlib inline\n",
36-
"%load_ext autoreload\n",
37-
"%autoreload 2\n",
3834
"\n",
3935
"params = Parameters('../test/data/models/lbcd/parameters')\n",
4036
"data = Data('../test/data/models/lbcd/data')\n",

notebooks/monte_carlo_param_resampling.ipynb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,13 @@
2525
"metadata": {},
2626
"outputs": [],
2727
"source": [
28-
"# Import modules and Jupyter environment variables\n",
29-
"import sys\n",
30-
"sys.path.append('..')\n",
3128
"from prms_python import Data, Optimizer, Parameters, util\n",
3229
"from prms_python.optimizer import resample_param as resample\n",
3330
"import numpy as np\n",
3431
"import matplotlib.pyplot as plt\n",
3532
"import matplotlib as mpl\n",
3633
"mpl.style.use('ggplot')\n",
37-
"%matplotlib inline\n",
38-
"%load_ext autoreload\n",
39-
"%autoreload 2"
34+
"%matplotlib inline"
4035
]
4136
},
4237
{

notebooks/param_examples.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
"metadata": {},
1818
"outputs": [],
1919
"source": [
20-
"import sys\n",
21-
"sys.path.append('..')\n",
2220
"import os, json\n",
2321
"import numpy as np\n",
2422
"import pandas as pd\n",

notebooks/scenario_series.ipynb

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"\n",
99
"The `prms_python` module provides the `ScenarioSeries` class to set up and run a number of simulations at once in parallel with a common purpose. One example would be to do some sensitivity analyses of a set of parameters. We'll show this application below. This notebook is compatible with Python 3.\n",
1010
"\n",
11-
"## scale snow_adj and rad_trncf by multiplicative factors\n",
11+
"## scale jh_coef and rad_trncf by multiplicative factors\n",
1212
"\n",
1313
"The example we'll show modifies `jh_coef` and `rad_trncf` by scaling them. "
1414
]
@@ -21,17 +21,13 @@
2121
},
2222
"outputs": [],
2323
"source": [
24-
"import sys\n",
25-
"sys.path.append('..')\n",
2624
"from prms_python import ScenarioSeries"
2725
]
2826
},
2927
{
3028
"cell_type": "code",
3129
"execution_count": 22,
32-
"metadata": {
33-
"collapsed": false
34-
},
30+
"metadata": {},
3531
"outputs": [],
3632
"source": [
3733
"base_dir = '../test/data/models/lbcd/'\n",
@@ -57,9 +53,7 @@
5753
{
5854
"cell_type": "code",
5955
"execution_count": 23,
60-
"metadata": {
61-
"collapsed": false
62-
},
56+
"metadata": {},
6357
"outputs": [],
6458
"source": [
6559
"import numpy as np\n",
@@ -93,9 +87,7 @@
9387
{
9488
"cell_type": "code",
9589
"execution_count": 24,
96-
"metadata": {
97-
"collapsed": false
98-
},
90+
"metadata": {},
9991
"outputs": [],
10092
"source": [
10193
"sc_series.run() # alternatively sc_series.run(nproc=10)"
@@ -113,9 +105,7 @@
113105
{
114106
"cell_type": "code",
115107
"execution_count": 25,
116-
"metadata": {
117-
"collapsed": false
118-
},
108+
"metadata": {},
119109
"outputs": [
120110
{
121111
"name": "stdout",
@@ -165,9 +155,7 @@
165155
{
166156
"cell_type": "code",
167157
"execution_count": 26,
168-
"metadata": {
169-
"collapsed": false
170-
},
158+
"metadata": {},
171159
"outputs": [
172160
{
173161
"data": {
@@ -438,9 +426,7 @@
438426
{
439427
"cell_type": "code",
440428
"execution_count": 27,
441-
"metadata": {
442-
"collapsed": false
443-
},
429+
"metadata": {},
444430
"outputs": [
445431
{
446432
"data": {
@@ -496,9 +482,7 @@
496482
{
497483
"cell_type": "code",
498484
"execution_count": 28,
499-
"metadata": {
500-
"collapsed": false
501-
},
485+
"metadata": {},
502486
"outputs": [
503487
{
504488
"data": {
@@ -562,9 +546,7 @@
562546
{
563547
"cell_type": "code",
564548
"execution_count": 29,
565-
"metadata": {
566-
"collapsed": false
567-
},
549+
"metadata": {},
568550
"outputs": [
569551
{
570552
"data": {
@@ -595,9 +577,7 @@
595577
{
596578
"cell_type": "code",
597579
"execution_count": 30,
598-
"metadata": {
599-
"collapsed": false
600-
},
580+
"metadata": {},
601581
"outputs": [
602582
{
603583
"name": "stdout",
@@ -615,9 +595,7 @@
615595
{
616596
"cell_type": "code",
617597
"execution_count": 31,
618-
"metadata": {
619-
"collapsed": false
620-
},
598+
"metadata": {},
621599
"outputs": [
622600
{
623601
"name": "stdout",
@@ -640,9 +618,7 @@
640618
{
641619
"cell_type": "code",
642620
"execution_count": 32,
643-
"metadata": {
644-
"collapsed": false
645-
},
621+
"metadata": {},
646622
"outputs": [],
647623
"source": [
648624
"observed = data_df.runoff_1\n",
@@ -657,9 +633,7 @@
657633
{
658634
"cell_type": "code",
659635
"execution_count": 33,
660-
"metadata": {
661-
"collapsed": false
662-
},
636+
"metadata": {},
663637
"outputs": [
664638
{
665639
"data": {
@@ -713,13 +687,9 @@
713687
"name": "python",
714688
"nbconvert_exporter": "python",
715689
"pygments_lexer": "ipython3",
716-
"version": "3.4.3+"
717-
},
718-
"widgets": {
719-
"state": {},
720-
"version": "1.1.1"
690+
"version": "3.5.2"
721691
}
722692
},
723693
"nbformat": 4,
724-
"nbformat_minor": 0
694+
"nbformat_minor": 1
725695
}

notebooks/statvarfile.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"metadata": {},
1717
"outputs": [],
1818
"source": [
19-
"import sys, os\n",
20-
"sys.path.append('..')\n",
19+
"import os\n",
2120
"from prms_python.util import load_statvar \n",
2221
"import matplotlib.pyplot as plt\n",
2322
"import pandas as pd\n",

0 commit comments

Comments
 (0)