From c89f9ac9997a35a5078c78fb66ea1a13fde6e092 Mon Sep 17 00:00:00 2001 From: veenstrajelmer Date: Thu, 30 Jan 2025 22:02:43 +0100 Subject: [PATCH] updated notebook --- .github/workflows/pytest-py313.yml | 2 +- .github/workflows/pytest-py39-mindeps.yml | 2 +- .github/workflows/pytest.yml | 2 +- docs/CONTRIBUTING.md | 2 +- docs/notebooks/modelbuilder_example.ipynb | 19 ++++++++++++++++--- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pytest-py313.yml b/.github/workflows/pytest-py313.yml index 9a0b11f6..39527d99 100644 --- a/.github/workflows/pytest-py313.yml +++ b/.github/workflows/pytest-py313.yml @@ -40,4 +40,4 @@ jobs: COPERNICUSMARINE_SERVICE_USERNAME: ${{ secrets.COPERNICUSMARINE_SERVICE_USERNAME }} COPERNICUSMARINE_SERVICE_PASSWORD: ${{ secrets.COPERNICUSMARINE_SERVICE_PASSWORD }} run: | - pytest -m "not requireslocaldata and not era5slow" --cov=dfm_tools --cov-report xml --cov-report term + pytest -m "not requireslocaldata" --cov=dfm_tools --cov-report xml --cov-report term diff --git a/.github/workflows/pytest-py39-mindeps.yml b/.github/workflows/pytest-py39-mindeps.yml index e14a7b46..e9ebd2c9 100644 --- a/.github/workflows/pytest-py39-mindeps.yml +++ b/.github/workflows/pytest-py39-mindeps.yml @@ -47,4 +47,4 @@ jobs: COPERNICUSMARINE_SERVICE_USERNAME: ${{ secrets.COPERNICUSMARINE_SERVICE_USERNAME }} COPERNICUSMARINE_SERVICE_PASSWORD: ${{ secrets.COPERNICUSMARINE_SERVICE_PASSWORD }} run: | - pytest -m "not requireslocaldata and not era5slow" --cov=dfm_tools --cov-report xml --cov-report term + pytest -m "not requireslocaldata" --cov=dfm_tools --cov-report xml --cov-report term diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 91e64927..1aa8ab69 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -45,7 +45,7 @@ jobs: COPERNICUSMARINE_SERVICE_USERNAME: ${{ secrets.COPERNICUSMARINE_SERVICE_USERNAME }} COPERNICUSMARINE_SERVICE_PASSWORD: ${{ secrets.COPERNICUSMARINE_SERVICE_PASSWORD }} run: | - pytest -m "not requireslocaldata and not era5slow" --cov=dfm_tools --cov-report xml --cov-report term + pytest -m "not requireslocaldata" --cov=dfm_tools --cov-report xml --cov-report term - uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 741c04ea..163b9b67 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -68,7 +68,7 @@ - create and checkout branch for release - bump the versionnumber with `bumpversion minor` - update `docs/whats-new.md` and add a date to the current release heading -- run local testbank with `pytest -m "not era5slow and not requireslocaldata"` +- run local testbank with `pytest -m "not requireslocaldata"` - local check with: `python -m build` and `twine check dist/*` ([does not work on WCF](https://github.com/pypa/setuptools/issues/4133)) - commit+push to branch and merge PR - copy the dfm_tools version from [pyproject.toml](https://github.com/Deltares/dfm_tools/blob/main/pyproject.toml) (e.g. `0.11.0`) diff --git a/docs/notebooks/modelbuilder_example.ipynb b/docs/notebooks/modelbuilder_example.ipynb index b3f45f5b..d86bca39 100644 --- a/docs/notebooks/modelbuilder_example.ipynb +++ b/docs/notebooks/modelbuilder_example.ipynb @@ -1018,10 +1018,22 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 1, "id": "0f01a183", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'os' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[1], line 4\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# initialize mdu file and update settings\u001b[39;00m\n\u001b[0;32m 2\u001b[0m \u001b[38;5;66;03m# all keywords are documented in the Delft3D FM user manual\u001b[39;00m\n\u001b[0;32m 3\u001b[0m \u001b[38;5;66;03m# additional 2D/3D settings discussed in https://github.com/Deltares/dfm_tools/issues/951\u001b[39;00m\n\u001b[1;32m----> 4\u001b[0m mdu_file \u001b[38;5;241m=\u001b[39m \u001b[43mos\u001b[49m\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mjoin(dir_output, \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mmodel_name\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.mdu\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 5\u001b[0m mdu \u001b[38;5;241m=\u001b[39m hcdfm\u001b[38;5;241m.\u001b[39mFMModel()\n\u001b[0;32m 7\u001b[0m \u001b[38;5;66;03m# add the grid (_net.nc, network file)\u001b[39;00m\n", + "\u001b[1;31mNameError\u001b[0m: name 'os' is not defined" + ] + } + ], "source": [ "# initialize mdu file and update settings\n", "# all keywords are documented in the Delft3D FM user manual\n", @@ -1038,7 +1050,8 @@ "# create and add drypointsfile if there are any cells generated that will result in high orthogonality\n", "if len(illegalcells_gdf) > 0:\n", " illegalcells_polyfile = dfmt.geodataframe_to_PolyFile(illegalcells_gdf)\n", - " illegalcells_polyfile.save(os.path.join(dir_output,\"illegalcells.pol\"))\n", + " illegalcells_file = os.path.join(dir_output, \"illegalcells.pol\")\n", + " illegalcells_polyfile.save(illegalcells_file)\n", " mdu.geometry.drypointsfile = [illegalcells_polyfile]\n", "\n", "# update numerics settings\n",