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

minor changes to gitignore, notebooks #31

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/.name
.idea/jupyter-settings.xml
209 changes: 0 additions & 209 deletions demo_containerized_model.ipynb

This file was deleted.

132 changes: 101 additions & 31 deletions docs/source/example_model_run_HBV.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
"cell_type": "code",
"execution_count": 1,
"id": "ec7e710a-5aa4-40f9-a1cb-151e3cddbe04",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:32.492461800Z",
"start_time": "2024-03-07T14:21:31.890843300Z"
}
},
"outputs": [],
"source": [
"# general python\n",
Expand All @@ -29,7 +34,12 @@
"cell_type": "code",
"execution_count": 2,
"id": "4569a0f2-4bea-48cc-b5a4-ca5384e368c6",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.475126400Z",
"start_time": "2024-03-07T14:21:32.537461400Z"
}
},
"outputs": [],
"source": [
"# general eWC\n",
Expand All @@ -43,7 +53,7 @@
"id": "c1a08f9b",
"metadata": {},
"source": [
"Install required plugin with pip:m"
"Install required plugin with pip:"
]
},
{
Expand All @@ -70,23 +80,16 @@
"cell_type": "code",
"execution_count": 3,
"id": "df66893d-b667-4fcc-a841-683f32ed2cc7",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"PosixPath('/home/davidhaasnoot/Docs/Forcing')"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.485126600Z",
"start_time": "2024-03-07T14:21:34.478127800Z"
}
],
},
"outputs": [],
"source": [
"path = Path.cwd()\n",
"forcing_path = path / \"Forcing\"\n",
"forcing_path"
"forcing_path = path / \"Forcing\""
]
},
{
Expand All @@ -110,7 +113,12 @@
"cell_type": "code",
"execution_count": 4,
"id": "f70032e1-602a-4163-a338-2a3ff6264c00",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.494347400Z",
"start_time": "2024-03-07T14:21:34.484123900Z"
}
},
"outputs": [],
"source": [
"s_0 = np.array([0, 100, 0, 5])"
Expand All @@ -129,7 +137,12 @@
"cell_type": "code",
"execution_count": 5,
"id": "f4cff96b-5eca-4147-940f-9e8393034225",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.502125100Z",
"start_time": "2024-03-07T14:21:34.495134600Z"
}
},
"outputs": [],
"source": [
"p_min_initial= np.array([0, 0.2, 40, .5, .001, 1, .01, .0001])\n",
Expand All @@ -151,7 +164,12 @@
"cell_type": "code",
"execution_count": 6,
"id": "ed960ab6-b63a-4664-8306-b57c2ecf27ec",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.528887900Z",
"start_time": "2024-03-07T14:21:34.501125300Z"
}
},
"outputs": [],
"source": [
"par_0 = (p_min_initial + p_max_initial)/2"
Expand All @@ -169,7 +187,12 @@
"cell_type": "code",
"execution_count": 7,
"id": "03aea008-87ce-4d09-8d01-f12dfe6bb116",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.567126600Z",
"start_time": "2024-03-07T14:21:34.567126600Z"
}
},
"outputs": [],
"source": [
"experiment_start_date = \"1997-08-01T00:00:00Z\"\n",
Expand All @@ -190,7 +213,12 @@
"cell_type": "code",
"execution_count": 8,
"id": "41855c32-2650-403e-bcad-332eab6c1ec4",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.568127600Z",
"start_time": "2024-03-07T14:21:34.567126600Z"
}
},
"outputs": [],
"source": [
"from ewatercycle_HBV.forcing import HBVForcing"
Expand All @@ -208,7 +236,12 @@
"cell_type": "code",
"execution_count": 9,
"id": "6249ec9f-8ff2-4181-ac6f-cac309d8cf72",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.568127600Z",
"start_time": "2024-03-07T14:21:34.568127600Z"
}
},
"outputs": [],
"source": [
"camels_forcing = HBVForcing(start_time = experiment_start_date,\n",
Expand All @@ -231,7 +264,12 @@
"cell_type": "code",
"execution_count": 10,
"id": "d62a1be2-e5a1-4c82-aaf0-9ab2eeea14af",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.569218800Z",
"start_time": "2024-03-07T14:21:34.568127600Z"
}
},
"outputs": [],
"source": [
"from ewatercycle.models import HBV"
Expand All @@ -241,7 +279,12 @@
"cell_type": "code",
"execution_count": 11,
"id": "6160254a-89f6-4234-a74f-140edff3efb5",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.569218800Z",
"start_time": "2024-03-07T14:21:34.568127600Z"
}
},
"outputs": [],
"source": [
"model = HBV(forcing=camels_forcing)"
Expand All @@ -251,7 +294,12 @@
"cell_type": "code",
"execution_count": 12,
"id": "ebbd898f-b3cc-4d03-8050-21067d31c1e8",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.948731400Z",
"start_time": "2024-03-07T14:21:34.568127600Z"
}
},
"outputs": [],
"source": [
"config_file, _ = model.setup(\n",
Expand All @@ -264,7 +312,12 @@
"cell_type": "code",
"execution_count": 13,
"id": "ba14b408-e446-45aa-b406-91dc35f40bc1",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:34.957732500Z",
"start_time": "2024-03-07T14:21:34.953733500Z"
}
},
"outputs": [],
"source": [
"model.initialize(config_file)"
Expand All @@ -282,7 +335,11 @@
"cell_type": "code",
"execution_count": 14,
"id": "579fe3d8-0418-4e76-9d66-9c1a938812cc",
"metadata": {},
"metadata": {
"ExecuteTime": {
"start_time": "2024-03-07T14:21:34.997729900Z"
}
},
"outputs": [],
"source": [
"Q_m = []\n",
Expand All @@ -305,7 +362,12 @@
"cell_type": "code",
"execution_count": 15,
"id": "a6fd6178-1059-497a-a91f-dd0fa983df2a",
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2024-03-07T14:21:35.030728200Z",
"start_time": "2024-03-07T14:21:34.997729900Z"
}
},
"outputs": [],
"source": [
"model.finalize()"
Expand All @@ -323,7 +385,11 @@
"cell_type": "code",
"execution_count": 16,
"id": "ccde9dca-258d-409c-a602-d4abda553b32",
"metadata": {},
"metadata": {
"ExecuteTime": {
"start_time": "2024-03-07T14:21:34.997729900Z"
}
},
"outputs": [],
"source": [
"df = pd.DataFrame(data=Q_m,columns=[\"Modeled discharge\"],index=time)"
Expand All @@ -333,7 +399,11 @@
"cell_type": "code",
"execution_count": 17,
"id": "a39c2e98-30d0-4658-adbd-b2feae7062f4",
"metadata": {},
"metadata": {
"ExecuteTime": {
"start_time": "2024-03-07T14:21:34.997729900Z"
}
},
"outputs": [
{
"data": {
Expand Down
Loading
Loading