Skip to content

Commit 6393fef

Browse files
committed
re-run nbs on snellius
1 parent a266471 commit 6393fef

2 files changed

Lines changed: 78 additions & 85 deletions

File tree

notebooks/run_model_in_notebook.ipynb

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -88,29 +88,29 @@
8888
},
8989
{
9090
"cell_type": "code",
91-
"execution_count": 9,
91+
"execution_count": 5,
9292
"metadata": {},
9393
"outputs": [
9494
{
9595
"data": {
9696
"text/plain": [
97-
"{'WorkDir': '/home/sarah/temp/ecoextreml/test/',\n",
98-
" 'SoilPropertyPath': '/home/sarah/temp/ecoextreml/data/model_parameters/soil_property/',\n",
99-
" 'ForcingPath': '/home/sarah/temp/ecoextreml/data/forcing/plumber2_data/',\n",
100-
" 'ForcingFileName': 'AR-SLu_2010-2010_FLUXNET2015_Met.nc',\n",
101-
" 'directional': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/directional/',\n",
102-
" 'fluspect_parameters': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/fluspect_parameters/',\n",
103-
" 'leafangles': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/leafangles/',\n",
104-
" 'radiationdata': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/radiationdata/',\n",
105-
" 'soil_spectrum': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/soil_spectrum/',\n",
106-
" 'InitialConditionPath': '/home/sarah/temp/ecoextreml/soil_initialcondition/',\n",
107-
" 'input_data': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/input_data.xlsx',\n",
97+
"{'WorkDir': '/scratch-shared/ecoextreml/stemmus_scope/',\n",
98+
" 'SoilPropertyPath': '/projects/0/einf2480/model_parameters/soil_property/',\n",
99+
" 'ForcingPath': '/projects/0/einf2480/forcing/plumber2_data/',\n",
100+
" 'ForcingFileName': 'FI-Hyy_1996-2014_FLUXNET2015_Met.nc',\n",
101+
" 'directional': '/projects/0/einf2480/model_parameters/vegetation_property/directional/',\n",
102+
" 'fluspect_parameters': '/projects/0/einf2480/model_parameters/vegetation_property/fluspect_parameters/',\n",
103+
" 'leafangles': '/projects/0/einf2480/model_parameters/vegetation_property/leafangles/',\n",
104+
" 'radiationdata': '/projects/0/einf2480/model_parameters/vegetation_property/radiationdata/',\n",
105+
" 'soil_spectrum': '/projects/0/einf2480/model_parameters/vegetation_property/soil_spectrum/',\n",
106+
" 'input_data': '/projects/0/einf2480/model_parameters/vegetation_property/input_data.xlsx',\n",
107+
" 'InitialConditionPath': '/projects/0/einf2480/soil_initialcondition/',\n",
108108
" 'NumberOfTimeSteps': '5',\n",
109-
" 'InputPath': '/will_be_created_under_WorkDir/input/AU-DaS_2022-05-11-1705/',\n",
110-
" 'OutputPath': '/home/sarah/temp/ecoextreml/output/AR-SLu_2022-07-29-1451/'}"
109+
" 'InputPath': '',\n",
110+
" 'OutputPath': ''}"
111111
]
112112
},
113-
"execution_count": 9,
113+
"execution_count": 5,
114114
"metadata": {},
115115
"output_type": "execute_result"
116116
}
@@ -125,14 +125,14 @@
125125
},
126126
{
127127
"cell_type": "code",
128-
"execution_count": 10,
128+
"execution_count": 6,
129129
"metadata": {},
130130
"outputs": [
131131
{
132132
"name": "stdout",
133133
"output_type": "stream",
134134
"text": [
135-
"/home/sarah/temp/ecoextreml/test/input/ZA-Kru_2022-08-03-1537/ZA-Kru_2022-08-03-1537_config.txt\n"
135+
"/gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1439/ZA-Kru_2022-08-08-1439_config.txt\n"
136136
]
137137
}
138138
],
@@ -147,29 +147,29 @@
147147
},
148148
{
149149
"cell_type": "code",
150-
"execution_count": 11,
150+
"execution_count": 7,
151151
"metadata": {},
152152
"outputs": [
153153
{
154154
"data": {
155155
"text/plain": [
156-
"{'WorkDir': '/home/sarah/temp/ecoextreml/test/',\n",
157-
" 'SoilPropertyPath': '/home/sarah/temp/ecoextreml/data/model_parameters/soil_property/',\n",
158-
" 'ForcingPath': '/home/sarah/temp/ecoextreml/data/forcing/plumber2_data/',\n",
156+
"{'WorkDir': '/scratch-shared/ecoextreml/stemmus_scope/',\n",
157+
" 'SoilPropertyPath': '/projects/0/einf2480/model_parameters/soil_property/',\n",
158+
" 'ForcingPath': '/projects/0/einf2480/forcing/plumber2_data/',\n",
159159
" 'ForcingFileName': 'ZA-Kru_2000-2002_FLUXNET2015_Met.nc',\n",
160-
" 'directional': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/directional/',\n",
161-
" 'fluspect_parameters': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/fluspect_parameters/',\n",
162-
" 'leafangles': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/leafangles/',\n",
163-
" 'radiationdata': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/radiationdata/',\n",
164-
" 'soil_spectrum': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/soil_spectrum/',\n",
165-
" 'InitialConditionPath': '/home/sarah/temp/ecoextreml/soil_initialcondition/',\n",
166-
" 'input_data': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/input_data.xlsx',\n",
160+
" 'directional': '/projects/0/einf2480/model_parameters/vegetation_property/directional/',\n",
161+
" 'fluspect_parameters': '/projects/0/einf2480/model_parameters/vegetation_property/fluspect_parameters/',\n",
162+
" 'leafangles': '/projects/0/einf2480/model_parameters/vegetation_property/leafangles/',\n",
163+
" 'radiationdata': '/projects/0/einf2480/model_parameters/vegetation_property/radiationdata/',\n",
164+
" 'soil_spectrum': '/projects/0/einf2480/model_parameters/vegetation_property/soil_spectrum/',\n",
165+
" 'input_data': '/projects/0/einf2480/model_parameters/vegetation_property/input_data.xlsx',\n",
166+
" 'InitialConditionPath': '/projects/0/einf2480/soil_initialcondition/',\n",
167167
" 'NumberOfTimeSteps': '10',\n",
168-
" 'InputPath': '/home/sarah/temp/ecoextreml/test/input/ZA-Kru_2022-08-03-1537/',\n",
169-
" 'OutputPath': '/home/sarah/temp/ecoextreml/test/output/ZA-Kru_2022-08-03-1537/'}"
168+
" 'InputPath': '/gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1439/',\n",
169+
" 'OutputPath': '/gpfs/scratch1/shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-08-08-1439/'}"
170170
]
171171
},
172-
"execution_count": 11,
172+
"execution_count": 7,
173173
"metadata": {},
174174
"output_type": "execute_result"
175175
}
@@ -181,16 +181,16 @@
181181
},
182182
{
183183
"cell_type": "code",
184-
"execution_count": 12,
184+
"execution_count": 8,
185185
"metadata": {},
186186
"outputs": [
187187
{
188188
"data": {
189189
"text/plain": [
190-
"b'Reading config from /home/sarah/temp/ecoextreml/test/input/ZA-Kru_2022-08-03-1537/ZA-Kru_2022-08-03-1537_config.txt\\n\\n The calculations start now \\r\\n The calculations end now \\r'"
190+
"b'Opening log file: /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1439//java.log.51183\\nReading config from /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1439/ZA-Kru_2022-08-08-1439_config.txt\\nThe calculations start now\\nThe calculations end now\\n'"
191191
]
192192
},
193-
"execution_count": 12,
193+
"execution_count": 8,
194194
"metadata": {},
195195
"output_type": "execute_result"
196196
}
@@ -203,21 +203,21 @@
203203
},
204204
{
205205
"cell_type": "code",
206-
"execution_count": 14,
206+
"execution_count": 9,
207207
"metadata": {},
208208
"outputs": [
209209
{
210210
"name": "stdout",
211211
"output_type": "stream",
212212
"text": [
213-
"/home/sarah/temp/ecoextreml/test/output/ZA-Kru_2022-08-03-1537/ZA-Kru_2022-08-03-1537_STEMMUS_SCOPE.nc\n"
213+
"/gpfs/scratch1/shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-08-08-1439/ZA-Kru_2022-08-08-1439_STEMMUS_SCOPE.nc\n"
214214
]
215215
}
216216
],
217217
"source": [
218218
"# save output in netcdf format\n",
219-
"variables_will_be_in_NetCDF_file = \"./STEMMUS_SCOPE/utils/csv_to_nc/required_netcdf_variables.csv\"\n",
220-
"nc_file_name = save.to_netcdf(model.config, variables_will_be_in_NetCDF_file)\n",
219+
"required_netcdf_variables = \"./required_netcdf_variables.csv\"\n",
220+
"nc_file_name = save.to_netcdf(model.config, required_netcdf_variables)\n",
221221
"print(nc_file_name)"
222222
]
223223
},
@@ -230,17 +230,17 @@
230230
},
231231
{
232232
"cell_type": "code",
233-
"execution_count": 15,
233+
"execution_count": 10,
234234
"metadata": {},
235235
"outputs": [
236236
{
237237
"name": "stdout",
238238
"output_type": "stream",
239239
"text": [
240-
"b'Reading config from /home/sarah/temp/ecoextreml/test/input/ZA-Kru_2022-08-03-1541/ZA-Kru_2022-08-03-1541_config.txt\\n\\n The calculations start now \\r\\n The calculations end now \\r'\n",
241-
"/home/sarah/temp/ecoextreml/test/output/ZA-Kru_2022-08-03-1541/ZA-Kru_2022-08-03-1541_STEMMUS_SCOPE.nc\n",
242-
"b'Reading config from /home/sarah/temp/ecoextreml/test/input/AR-SLu_2022-08-03-1541/AR-SLu_2022-08-03-1541_config.txt\\n\\n The calculations start now \\r\\n The calculations end now \\r'\n",
243-
"/home/sarah/temp/ecoextreml/test/output/AR-SLu_2022-08-03-1541/AR-SLu_2022-08-03-1541_STEMMUS_SCOPE.nc\n"
240+
"b'Opening log file: /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1442//java.log.63885\\nReading config from /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1442/ZA-Kru_2022-08-08-1442_config.txt\\nThe calculations start now\\nThe calculations end now\\n'\n",
241+
"/gpfs/scratch1/shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-08-08-1442/ZA-Kru_2022-08-08-1442_STEMMUS_SCOPE.nc\n",
242+
"b'Opening log file: /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/AR-SLu_2022-08-08-1442//java.log.403\\nReading config from /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/AR-SLu_2022-08-08-1442/AR-SLu_2022-08-08-1442_config.txt\\nThe calculations start now\\nThe calculations end now\\n'\n",
243+
"/gpfs/scratch1/shared/ecoextreml/stemmus_scope/output/AR-SLu_2022-08-08-1442/AR-SLu_2022-08-08-1442_STEMMUS_SCOPE.nc\n"
244244
]
245245
}
246246
],
@@ -266,10 +266,17 @@
266266
" print(result)\n",
267267
" \n",
268268
" # save results in a netcdf file\n",
269-
" nc_file_name = save.to_netcdf(model.config, variables_will_be_in_NetCDF_file)\n",
269+
" nc_file_name = save.to_netcdf(model.config, required_netcdf_variables)\n",
270270
" print(nc_file_name)\n",
271271
" "
272272
]
273+
},
274+
{
275+
"cell_type": "code",
276+
"execution_count": null,
277+
"metadata": {},
278+
"outputs": [],
279+
"source": []
273280
}
274281
],
275282
"metadata": {

notebooks/run_model_in_notebook_dev.ipynb

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": 1,
13+
"execution_count": 9,
1414
"metadata": {},
1515
"outputs": [],
1616
"source": [
1717
"import os\n",
1818
"from pathlib import Path\n",
1919
"import subprocess\n",
20-
"from PyStemmusScope import StemmusScope"
20+
"from PyStemmusScope import StemmusScope\n",
21+
"from PyStemmusScope import save"
2122
]
2223
},
2324
{
@@ -48,31 +49,9 @@
4849
},
4950
{
5051
"cell_type": "code",
51-
"execution_count": 3,
52+
"execution_count": null,
5253
"metadata": {},
53-
"outputs": [
54-
{
55-
"name": "stdout",
56-
"output_type": "stream",
57-
"text": [
58-
"Already on 'python-compliant'\n",
59-
"Your branch is up to date with 'origin/python-compliant'.\n",
60-
"On branch python-compliant\n",
61-
"Your branch is up to date with 'origin/python-compliant'.\n",
62-
"\n",
63-
"Untracked files:\n",
64-
" (use \"git add <file>...\" to include in what will be committed)\n",
65-
"\t\u001b[31mexe/mccExcludedFiles.log\u001b[m\n",
66-
"\t\u001b[31mexe/readme.txt\u001b[m\n",
67-
"\t\u001b[31mexe/requiredMCRProducts.txt\u001b[m\n",
68-
"\t\u001b[31mexe/run_STEMMUS_SCOPE.sh\u001b[m\n",
69-
"\t\u001b[31mexe/unresolvedSymbols.txt\u001b[m\n",
70-
"\t\u001b[31mslurm_1224932.out\u001b[m\n",
71-
"\n",
72-
"nothing added to commit but untracked files present (use \"git add\" to track)\n"
73-
]
74-
}
75-
],
54+
"outputs": [],
7655
"source": [
7756
"dev_branch = \"python-compliant\"\n",
7857
"!git -C {path_to_model} checkout {dev_branch}\n",
@@ -105,9 +84,9 @@
10584
" 'soil_spectrum': '/projects/0/einf2480/model_parameters/vegetation_property/soil_spectrum/',\n",
10685
" 'input_data': '/projects/0/einf2480/model_parameters/vegetation_property/input_data.xlsx',\n",
10786
" 'InitialConditionPath': '/projects/0/einf2480/soil_initialcondition/',\n",
108-
" 'NumberOfTimeSteps': '17520',\n",
109-
" 'InputPath': '/scratch-shared/ecoextreml/stemmus_scope/input/FI-Hyy_2022-05-11-1705/',\n",
110-
" 'OutputPath': '/scratch-shared/ecoextreml/stemmus_scope/output/FI-Hyy_2022-05-11-1705/'}"
87+
" 'NumberOfTimeSteps': '5',\n",
88+
" 'InputPath': '',\n",
89+
" 'OutputPath': ''}"
11190
]
11291
},
11392
"execution_count": 4,
@@ -137,7 +116,7 @@
137116
"name": "stdout",
138117
"output_type": "stream",
139118
"text": [
140-
"/gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-07-18-1651/ZA-Kru_2022-07-18-1651_config.txt\n"
119+
"/gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1446/ZA-Kru_2022-08-08-1446_config.txt\n"
141120
]
142121
}
143122
],
@@ -170,8 +149,8 @@
170149
" 'input_data': '/projects/0/einf2480/model_parameters/vegetation_property/input_data.xlsx',\n",
171150
" 'InitialConditionPath': '/projects/0/einf2480/soil_initialcondition/',\n",
172151
" 'NumberOfTimeSteps': '5',\n",
173-
" 'InputPath': '/gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-07-18-1651/',\n",
174-
" 'OutputPath': '/gpfs/scratch1/shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-07-18-1651/'}"
152+
" 'InputPath': '/gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1446/',\n",
153+
" 'OutputPath': '/gpfs/scratch1/shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-08-08-1446/'}"
175154
]
176155
},
177156
"execution_count": 6,
@@ -203,7 +182,7 @@
203182
"output_type": "stream",
204183
"text": [
205184
"MATLAB is selecting SOFTWARE OPENGL rendering.\n",
206-
"Opening log file: /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-07-18-1651//java.log.35508\n",
185+
"Opening log file: /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1446//java.log.32841\n",
207186
"\n",
208187
" < M A T L A B (R) >\n",
209188
" Copyright 1984-2021 The MathWorks, Inc.\n",
@@ -214,10 +193,9 @@
214193
"To get started, type doc.\n",
215194
"For product information, visit www.mathworks.com.\n",
216195
" \n",
217-
"Reading config from /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-07-18-1651/ZA-Kru_2022-07-18-1651_config.txt\n",
218-
"\n",
219-
" The calculations start now \n",
220-
" The calculations end now \r"
196+
"Reading config from /gpfs/scratch1/shared/ecoextreml/stemmus_scope/input/ZA-Kru_2022-08-08-1446/ZA-Kru_2022-08-08-1446_config.txt\n",
197+
"The calculations start now\n",
198+
"The calculations end now\n"
221199
]
222200
}
223201
],
@@ -244,12 +222,20 @@
244222
},
245223
{
246224
"cell_type": "code",
247-
"execution_count": null,
225+
"execution_count": 10,
248226
"metadata": {},
249-
"outputs": [],
227+
"outputs": [
228+
{
229+
"name": "stdout",
230+
"output_type": "stream",
231+
"text": [
232+
"/gpfs/scratch1/shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-08-08-1446/ZA-Kru_2022-08-08-1446_STEMMUS_SCOPE.nc\n"
233+
]
234+
}
235+
],
250236
"source": [
251-
"variables_will_be_in_NetCDF_file = path_to_model / \"utils\" / \"csv_to_nc\" / \"required_netcdf_variables.csv\"\n",
252-
"nc_file_name = save.to_netcdf(model.config, variables_will_be_in_NetCDF_file)\n",
237+
"required_netcdf_variables = path_to_model / \"utils\" / \"csv_to_nc\" / \"required_netcdf_variables.csv\"\n",
238+
"nc_file_name = save.to_netcdf(model.config, required_netcdf_variables)\n",
253239
"print(nc_file_name)"
254240
]
255241
},

0 commit comments

Comments
 (0)