Skip to content

Commit 6ae8054

Browse files
authored
Merge pull request #3 from interTwin-eu/update
small updates
2 parents 21d779f + f401969 commit 6ae8054

File tree

4 files changed

+124
-14
lines changed

4 files changed

+124
-14
lines changed

docker/hydromt/config_gen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ def main():
223223
"setup_temp_pet_forcing": {
224224
"temp_pet_fn": temp_pet_fn,
225225
"kin_fn": "cerra_land_stac",
226-
"press_correction": "True",
226+
"press_correction": "False",
227227
"temp_correction": "True",
228228
"wind_correction": "False",
229-
"dem_forcing_fn": "cerra_orography",
229+
"dem_forcing_fn": "emo1_orography_stac",
230230
"pet_method": "makkink",
231-
"skip_pet": "False",
231+
"skip_pet": "True",
232232
"chunksize": 1,
233233
},
234234
"setup_constant_pars": {

example/configs/oscar_hydromt_script.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ echo "Generating config file for HydroMT"
1414
# Set defaults or use environment variables if provided
1515
model_resolution="${MODEL_RESOLUTION:-0.008999999999}"
1616
precip_fn="${PRECIP_FN:-emo1_stac}"
17+
temp_pet_fn="${TEMP_PET_FN:-emo1_stac}"
1718
starttime="${STARTTIME:-2001-01-01T00:00:00}"
1819
endtime="${ENDTIME:-2001-03-31T00:00:00}"
1920

2021
if ! python config_gen.py \
2122
--res "$model_resolution" \
2223
--precip_fn "$precip_fn" \
24+
--temp_pet_fn "$temp_pet_fn" \
2325
--starttime "$starttime" \
2426
--endtime "$endtime"
2527
then

example/usecase.ipynb

Lines changed: 115 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@
2626
},
2727
{
2828
"cell_type": "code",
29-
"execution_count": null,
29+
"execution_count": 1,
3030
"id": "1c48fc9c",
3131
"metadata": {},
32-
"outputs": [],
32+
"outputs": [
33+
{
34+
"name": "stderr",
35+
"output_type": "stream",
36+
"text": [
37+
"Did not load machine learning processes due to missing dependencies: Install them like this: `pip install openeo-processes-dask[implementations, ml]`\n"
38+
]
39+
}
40+
],
3341
"source": [
3442
"import openeo\n",
3543
"from openeo.local import LocalConnection\n",
@@ -90,10 +98,42 @@
9098
},
9199
{
92100
"cell_type": "code",
93-
"execution_count": null,
101+
"execution_count": 2,
94102
"id": "982b6a33",
95103
"metadata": {},
96-
"outputs": [],
104+
"outputs": [
105+
{
106+
"data": {
107+
"text/html": [
108+
"\n",
109+
" <script>\n",
110+
" if (!window.customElements || !window.customElements.get('openeo-model-builder')) {\n",
111+
" var el = document.createElement('script');\n",
112+
" el.src = \"https://cdn.jsdelivr.net/npm/@openeo/vue-components@2/assets/openeo.min.js\";\n",
113+
" document.head.appendChild(el);\n",
114+
"\n",
115+
" var font = document.createElement('font');\n",
116+
" font.as = \"font\";\n",
117+
" font.type = \"font/woff2\";\n",
118+
" font.crossOrigin = true;\n",
119+
" font.href = \"https://use.fontawesome.com/releases/v5.13.0/webfonts/fa-solid-900.woff2\"\n",
120+
" document.head.appendChild(font);\n",
121+
" }\n",
122+
" </script>\n",
123+
" <openeo-model-builder>\n",
124+
" <script type=\"application/json\">{\"id\": \"d5e1e104bbf34da19fc2a0f9782c429a\", \"explicit-zoom\": true, \"height\": \"400px\", \"value\": {\"process_graph\": {\"runoscar1\": {\"process_id\": \"run_oscar\", \"arguments\": {\"context\": {\"AWS_ACCESS_KEY_ID\": \"your_access_key_id\", \"AWS_SECRET_ACCESS_KEY\": \"your_secret_access_key\", \"RES\": \"0.008999999999\", \"PRECIP_FN\": \"emo1_stac\", \"STARTTIME\": \"2001-01-01T00:00:00\", \"ENDTIME\": \"2001-03-31T00:00:00\"}, \"input_stac_url\": \"https://stac.example.com/item/123\", \"local_refresh_token\": \"/home/jzvolensky/.local/share/openeo-python-client/refresh-tokens.json\", \"oscar_endpoint\": \"https://oscar-ukri.intertwin.fedcloud.eu/\", \"oscar_script\": null, \"output\": \"output\", \"service\": \"hydroform-hydromt\", \"service_config\": \"./configs/oscar_hydromt_svc.yaml\"}, \"result\": true}}}}</script>\n",
125+
" </openeo-model-builder>\n",
126+
" "
127+
],
128+
"text/plain": [
129+
"<openeo.rest.datacube.DataCube at 0x7fbc03459790>"
130+
]
131+
},
132+
"execution_count": 2,
133+
"metadata": {},
134+
"output_type": "execute_result"
135+
}
136+
],
97137
"source": [
98138
"hydromt_step = localconn.datacube_from_process(\n",
99139
" \"run_oscar\",\n",
@@ -157,10 +197,42 @@
157197
},
158198
{
159199
"cell_type": "code",
160-
"execution_count": null,
200+
"execution_count": 4,
161201
"id": "619e5c4e",
162202
"metadata": {},
163-
"outputs": [],
203+
"outputs": [
204+
{
205+
"data": {
206+
"text/html": [
207+
"\n",
208+
" <script>\n",
209+
" if (!window.customElements || !window.customElements.get('openeo-model-builder')) {\n",
210+
" var el = document.createElement('script');\n",
211+
" el.src = \"https://cdn.jsdelivr.net/npm/@openeo/vue-components@2/assets/openeo.min.js\";\n",
212+
" document.head.appendChild(el);\n",
213+
"\n",
214+
" var font = document.createElement('font');\n",
215+
" font.as = \"font\";\n",
216+
" font.type = \"font/woff2\";\n",
217+
" font.crossOrigin = true;\n",
218+
" font.href = \"https://use.fontawesome.com/releases/v5.13.0/webfonts/fa-solid-900.woff2\"\n",
219+
" document.head.appendChild(font);\n",
220+
" }\n",
221+
" </script>\n",
222+
" <openeo-model-builder>\n",
223+
" <script type=\"application/json\">{\"id\": \"a2a8d6bce7ee4d21be20759c5cfe6011\", \"explicit-zoom\": true, \"height\": \"400px\", \"value\": {\"process_graph\": {\"runoscar1\": {\"process_id\": \"run_oscar\", \"arguments\": {\"context\": {\"AWS_ACCESS_KEY_ID\": \"your_access_key_id\", \"AWS_SECRET_ACCESS_KEY\": \"your_secret_access_key\", \"RES\": \"0.008999999999\", \"PRECIP_FN\": \"emo1_stac\", \"STARTTIME\": \"2001-01-01T00:00:00\", \"ENDTIME\": \"2001-03-31T00:00:00\"}, \"input_stac_url\": \"https://stac.example.com/item/123\", \"local_refresh_token\": \"/home/jzvolensky/.local/share/openeo-python-client/refresh-tokens.json\", \"oscar_endpoint\": \"https://oscar-ukri.intertwin.fedcloud.eu/\", \"oscar_script\": null, \"output\": \"output\", \"service\": \"hydroform-hydromt\", \"service_config\": \"./configs/oscar_hydromt_svc.yaml\"}}, \"runoscar2\": {\"process_id\": \"run_oscar\", \"arguments\": {\"context\": {\"AWS_ACCESS_KEY_ID\": \"your_access_key_id\", \"AWS_SECRET_ACCESS_KEY\": \"your_secret_access_key\"}, \"input_stac_url\": {\"from_node\": \"runoscar1\"}, \"local_refresh_token\": \"/home/jzvolensky/.local/share/openeo-python-client/refresh-tokens.json\", \"oscar_endpoint\": \"https://oscar-ukri.intertwin.fedcloud.eu/\", \"oscar_script\": null, \"output\": \"output2\", \"service\": \"hydroform-wflow\", \"service_config\": \"./configs/oscar_wflow_svc.yaml\"}, \"result\": true}}}}</script>\n",
224+
" </openeo-model-builder>\n",
225+
" "
226+
],
227+
"text/plain": [
228+
"<openeo.rest.datacube.DataCube at 0x7fbc01eff0e0>"
229+
]
230+
},
231+
"execution_count": 4,
232+
"metadata": {},
233+
"output_type": "execute_result"
234+
}
235+
],
164236
"source": [
165237
"wflow_step = localconn.datacube_from_process(\n",
166238
" \"run_oscar\",\n",
@@ -175,7 +247,9 @@
175247
" \"AWS_ACCESS_KEY_ID\": \"your_access_key_id\",\n",
176248
" \"AWS_SECRET_ACCESS_KEY\": \"your_secret_access_key\"\n",
177249
" }\n",
178-
")"
250+
")\n",
251+
"\n",
252+
"wflow_step"
179253
]
180254
},
181255
{
@@ -198,10 +272,42 @@
198272
},
199273
{
200274
"cell_type": "code",
201-
"execution_count": null,
275+
"execution_count": 5,
202276
"id": "e63ac620",
203277
"metadata": {},
204-
"outputs": [],
278+
"outputs": [
279+
{
280+
"data": {
281+
"text/html": [
282+
"\n",
283+
" <script>\n",
284+
" if (!window.customElements || !window.customElements.get('openeo-model-builder')) {\n",
285+
" var el = document.createElement('script');\n",
286+
" el.src = \"https://cdn.jsdelivr.net/npm/@openeo/vue-components@2/assets/openeo.min.js\";\n",
287+
" document.head.appendChild(el);\n",
288+
"\n",
289+
" var font = document.createElement('font');\n",
290+
" font.as = \"font\";\n",
291+
" font.type = \"font/woff2\";\n",
292+
" font.crossOrigin = true;\n",
293+
" font.href = \"https://use.fontawesome.com/releases/v5.13.0/webfonts/fa-solid-900.woff2\"\n",
294+
" document.head.appendChild(font);\n",
295+
" }\n",
296+
" </script>\n",
297+
" <openeo-model-builder>\n",
298+
" <script type=\"application/json\">{\"id\": \"628ea2f1890d42a7859eff84035e1f06\", \"explicit-zoom\": true, \"height\": \"400px\", \"value\": {\"process_graph\": {\"runoscar1\": {\"process_id\": \"run_oscar\", \"arguments\": {\"context\": {\"AWS_ACCESS_KEY_ID\": \"your_access_key_id\", \"AWS_SECRET_ACCESS_KEY\": \"your_secret_access_key\", \"RES\": \"0.008999999999\", \"PRECIP_FN\": \"emo1_stac\", \"STARTTIME\": \"2001-01-01T00:00:00\", \"ENDTIME\": \"2001-03-31T00:00:00\"}, \"input_stac_url\": \"https://stac.example.com/item/123\", \"local_refresh_token\": \"/home/jzvolensky/.local/share/openeo-python-client/refresh-tokens.json\", \"oscar_endpoint\": \"https://oscar-ukri.intertwin.fedcloud.eu/\", \"oscar_script\": null, \"output\": \"output\", \"service\": \"hydroform-hydromt\", \"service_config\": \"./configs/oscar_hydromt_svc.yaml\"}}, \"runoscar2\": {\"process_id\": \"run_oscar\", \"arguments\": {\"context\": {\"AWS_ACCESS_KEY_ID\": \"your_access_key_id\", \"AWS_SECRET_ACCESS_KEY\": \"your_secret_access_key\"}, \"input_stac_url\": {\"from_node\": \"runoscar1\"}, \"local_refresh_token\": \"/home/jzvolensky/.local/share/openeo-python-client/refresh-tokens.json\", \"oscar_endpoint\": \"https://oscar-ukri.intertwin.fedcloud.eu/\", \"oscar_script\": null, \"output\": \"output2\", \"service\": \"hydroform-wflow\", \"service_config\": \"./configs/oscar_wflow_svc.yaml\"}}, \"runoscar3\": {\"process_id\": \"run_oscar\", \"arguments\": {\"context\": {\"AWS_ACCESS_KEY_ID\": \"your_access_key_id\", \"AWS_SECRET_ACCESS_KEY\": \"your_secret_access_key\", \"MLFLOW_TRACKING_URI\": \"your_mlflow_tracking_uri\", \"MLFLOW_TRACKING_USERNAME\": \"your_mlflow_username\", \"MLFLOW_TRACKING_PASSWORD\": \"your_mlflow_password\", \"MLFLOW_TRACKING_INSECURE_TLS\": \"true\"}, \"input_stac_url\": {\"from_node\": \"runoscar2\"}, \"local_refresh_token\": \"/home/jzvolensky/.local/share/openeo-python-client/refresh-tokens.json\", \"oscar_endpoint\": \"https://oscar-ukri.intertwin.fedcloud.eu/\", \"oscar_script\": null, \"output\": \"output3\", \"service\": \"hydroform-surrogate\", \"service_config\": \"./configs/oscar_surrogate_svc.yaml\"}, \"result\": true}}}}</script>\n",
299+
" </openeo-model-builder>\n",
300+
" "
301+
],
302+
"text/plain": [
303+
"<openeo.rest.datacube.DataCube at 0x7fbc01eff0b0>"
304+
]
305+
},
306+
"execution_count": 5,
307+
"metadata": {},
308+
"output_type": "execute_result"
309+
}
310+
],
205311
"source": [
206312
"surrogate_step = localconn.datacube_from_process(\n",
207313
" \"run_oscar\",\n",

tests/test_hydromt.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ ! -d "$HYDROMT_DIR/tmp" ]; then
1313
mkdir -p $HYDROMT_DIR/tmp
1414
fi
1515

16-
docker build --no-cache -f $HYDROMT_DIR/Dockerfile -t hydromt-test $HYDROMT_DIR
16+
docker build --no-cache -f $HYDROMT_DIR/Dockerfile -t hydromt-ecreview $HYDROMT_DIR
1717

1818
# Run the container
1919
# 1. config generation
@@ -23,16 +23,18 @@ docker build --no-cache -f $HYDROMT_DIR/Dockerfile -t hydromt-test $HYDROMT_DIR
2323

2424
model_resolution="${MODEL_RESOLUTION:-0.008999999999}"
2525
precip_fn="${PRECIP_FN:-emo1_stac}"
26+
temp_pet_fn="${TEMP_PET_FN:-emo1_stac}"
2627
starttime="${STARTTIME:-2001-01-01T00:00:00}"
2728
endtime="${ENDTIME:-2001-03-31T00:00:00}"
2829

2930
docker container run \
3031
-v $PWD/tests/tmp:/hydromt/model \
3132
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY \
32-
-it --rm potato55/hydromt-test:r2sfix /bin/bash -c "
33+
-it --rm hydromt-ecreview /bin/bash -c "
3334
python config_gen.py \
3435
--res \"$model_resolution\" \
3536
--precip_fn \"$precip_fn\" \
37+
--temp_pet_fn \"$temp_pet_fn\" \
3638
--starttime \"$starttime\" \
3739
--endtime \"$endtime\" \
3840
&& hydromt build wflow model -r \"{'subbasin': [11.4750, 46.8720]}\" -d data_catalog.yaml -i wflow.ini -vvv \

0 commit comments

Comments
 (0)