Skip to content

Commit

Permalink
Speed up docs (#144)
Browse files Browse the repository at this point in the history
* Disable some cells to speed up docs

* Update ahn.py

* Remove metadata of notebooks and add run_all_notebooks.py

* Some small improvements to notebooks

Specify raw_mimetype as "python"

* replace geodata.nationaalgeoregister.nl by geodata.nationaalgeoregister.nl

wcs-services from https://geodata.nationaalgeoregister.nl are not available anymore

* point nijmuiden notebooks to the same directory

* Update description in schoonhoven notebooks

* fix bug where modpath

reverts part of commit 6413c6f

* Add get_ahn_at_point

* change "full_ds.nc" to f"{ds.model_name}.nc"

* Update python-publish.yml

because of warning at version 4.0:
https://github.com/ArtesiaWater/nlmod/actions/runs/3377917857

And the fact that version 5.0 was not sent to pypi
  • Loading branch information
rubencalje authored Feb 21, 2023
1 parent 82c11b7 commit 2c075f7
Show file tree
Hide file tree
Showing 25 changed files with 522 additions and 903 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
python -m build --sdist --wheel --outdir dist/
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
21 changes: 1 addition & 20 deletions docs/examples/00_model_from_scratch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -305,27 +305,8 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
},
"vscode": {
"interpreter": {
"hash": "dace5e1b41a98a8e52d2a8eebc3b981caf2c12e7a76736ebfb89a489e3b62e79"
}
"name": "python"
}
},
"nbformat": 4,
Expand Down
69 changes: 11 additions & 58 deletions docs/examples/01_basic_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@
"This example notebook shows a basic example of a model created using online data with the `nlmod` package. `nlmod` contains functions to create modflow models anywhere in the Netherlands."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Contents<a name=\"TOC\"></a>\n",
"1. [Create model](#create)\n",
"2. [Run model](#run)\n",
"3. [Visualise](#visualise)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -52,7 +42,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### [1. Create model](#TOC)<a name=\"create\"></a>\n",
"## Create model\n",
"\n",
"With the code below we create a modflow model with the name 'IJmuiden'. This model has the following properties :\n",
"- an extent that covers part of the Northsea, Noordzeekanaal and the small port city IJmuiden.\n",
Expand All @@ -76,19 +66,16 @@
"outputs": [],
"source": [
"# model settings\n",
"model_ws = \"model1\"\n",
"model_ws = \"ijmuiden\"\n",
"model_name = \"IJmuiden\"\n",
"figdir, cachedir = nlmod.util.get_model_dirs(model_ws)\n",
"extent = [95000.0, 105000.0, 494000.0, 500000.0]\n",
"delr = 100.0\n",
"delc = 100.0\n",
"steady_state = True\n",
"start_time = \"2015-1-1\"\n",
"use_regis = True\n",
"regis_botm_layer = \"MSz1\"\n",
"use_geotop = True\n",
"add_northsea = True\n",
"starting_head = 1.0\n"
"starting_head = 1.0"
]
},
{
Expand All @@ -99,9 +86,9 @@
"source": [
"layer_model = nlmod.read.regis.get_combined_layer_models(\n",
" extent,\n",
" use_regis=use_regis,\n",
" regis_botm_layer=regis_botm_layer,\n",
" use_geotop=use_geotop,\n",
" use_regis=True,\n",
" regis_botm_layer=\"MSz1\",\n",
" use_geotop=True,\n",
" cachedir=cachedir,\n",
" cachename=\"combined_layer_ds.nc\",\n",
")\n",
Expand Down Expand Up @@ -232,7 +219,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### [2. Write and Run](#TOC)<a name=\"run\"></a>\n",
"## Write and Run\n",
"Now that we've created all the modflow packages we need to write them to modflow files. You always have to write the modflow data to the model workspace before you can run the model. You can write the model files and run the model using the function `nlmod.sim.write_and_run)` as shown below. This function has two additional options:\n",
"1. Write the model dataset to the disk if `write_ds` is `True`. This makes it easier and faster to load model data if you ever need it. \n",
"2. Write a copy of this Jupyter Notebook to the same directory as the modflow files if `nb_path` is the name of this Jupyter Notebook. It can be useful to have a copy of the script that created the modflow files, together with the files. "
Expand All @@ -253,8 +240,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### [3. Visualise](#TOC)<a name=\"visualise\"></a>\n",
"\n",
"## Visualise\n",
"Using the `ds` and `gwf` variables it is quite easy to visualise model data. Below the modelgrid together with the surface water is shown."
]
},
Expand All @@ -264,7 +250,8 @@
"metadata": {},
"outputs": [],
"source": [
"ax = nlmod.plot.modelgrid(ds)"
"ax = nlmod.plot.modelgrid(ds)\n",
"nlmod.plot.surface_water(ds, ax=ax)"
]
},
{
Expand Down Expand Up @@ -302,42 +289,8 @@
}
],
"metadata": {
"CodeCell": {
"cm_config": {
"lineWrapping": true
}
},
"MarkdownCell": {
"cm_config": {
"lineWrapping": true
}
},
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
},
"vscode": {
"interpreter": {
"hash": "dace5e1b41a98a8e52d2a8eebc3b981caf2c12e7a76736ebfb89a489e3b62e79"
}
},
"widgets": {
"state": {},
"version": "1.1.2"
"name": "python"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 2c075f7

Please sign in to comment.