diff --git a/notebooks/API.ipynb b/notebooks/API.ipynb index 05475b7..5513066 100644 --- a/notebooks/API.ipynb +++ b/notebooks/API.ipynb @@ -77,24 +77,6 @@ "The most convenient way to apply this normalization process is to use the `api.open_dataset()` function which is a wrapper around `xr.open_dataset()`." ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "c34a0afe-9394-4f49-8edc-90418609a280", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "%%bash\n", - "if [[ ! -f /tmp/fort.63.nc ]]; then\n", - " pushd /tmp\n", - " wget --quiet https://github.com/ec-jrc/Thalassa/files/10867068/fort.63.zip \n", - " unzip -o fort.63.zip\n", - " popd\n", - "fi" - ] - }, { "cell_type": "code", "execution_count": null, @@ -118,7 +100,7 @@ }, "outputs": [], "source": [ - "filename = \"/tmp/fort.63.nc\"\n", + "filename = \"../tests/data/fort.63.nc\"\n", "ds = api.open_dataset(filename)\n", "ds" ] diff --git a/notebooks/BBox_filtering.ipynb b/notebooks/BBox_filtering.ipynb index f161b5c..a7cf00c 100644 --- a/notebooks/BBox_filtering.ipynb +++ b/notebooks/BBox_filtering.ipynb @@ -15,6 +15,22 @@ "from __future__ import annotations" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "98ba7fda-b961-450c-b885-75176c8609dc", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "# debug\n", + "import sys\n", + "\n", + "print(sys.executable)\n", + "print(sys.version_info)" + ] + }, { "cell_type": "markdown", "id": "09b3a22a-1c7d-457b-973c-7ea35d65e22a", @@ -59,16 +75,14 @@ }, "outputs": [], "source": [ - "import os\n", - "\n", - "os.environ['USE_PYGEOS'] = '0' # remove geopandas warnings\n", - "\n", "import holoviews as hv\n", "import numpy as np\n", "import numpy_indexed as npi\n", "import pandas as pd\n", "import xarray as xr\n", "\n", + "from thalassa import api\n", + "\n", "hv.extension(\"bokeh\")" ] }, @@ -81,25 +95,7 @@ "source": [ "### Sample file\n", "\n", - "As an example let's download a netcdf file containing the output of an ADCIRC model.\n", - "\n", - "The file will be saved at `/tmp/fort.63.nc`:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e21e8260-7283-4094-b496-094834a5ad6f", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "%%bash\n", - "pushd /tmp\n", - "wget --quiet https://github.com/ec-jrc/Thalassa/files/10867068/fort.63.zip \n", - "unzip -o fort.63.zip\n", - "popd" + "As an example let's download a netcdf file containing the output of an ADCIRC model." ] }, { @@ -123,7 +119,7 @@ "source": [ "from thalassa import api\n", "\n", - "filename = \"/tmp/fort.63.nc\"\n", + "filename = \"../tests/data/fort.63.nc\"\n", "ds = api.open_dataset(filename)\n", "ds" ] @@ -135,9 +131,9 @@ "tags": [] }, "source": [ - "As we can see the model has 3070 nodes and 5780 trifaces (i.e. triangles)\n", + "As we can see the model has 3070 `nodes` and 5780 `trifaces` (i.e. triangles)\n", "\n", - "Note: The reason why the thalassa schema defines `triface` is because `face` might be referring to quad elements, too (in Schism models). `triface` always refers to triangles." + "Note: The reason why the thalassa schema defines `triface` is because `face` might be referring to quad elements, too (in Schism models; ADCIRC does not support them). `triface` always refers to triangles." ] }, { @@ -294,9 +290,9 @@ ], "metadata": { "kernelspec": { - "display_name": "thalassa2", + "display_name": "python3", "language": "python", - "name": "thalassa2" + "name": "python3" }, "language_info": { "codemirror_mode": {