From dbe36afe5e7b063466f4e92df6934d29b464554e Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Wed, 16 Oct 2024 06:52:14 +0200 Subject: [PATCH 1/2] update actions-checkout and setup-miniconda versions in actions (#180) --- .github/workflows/ci.yml | 2 +- .github/workflows/docs.yml | 7 +++---- .github/workflows/linting.yml | 2 +- .github/workflows/publish.yml | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be7f6065..c7d04f9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: cancel-in-progress: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6193eefd..f5240f57 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,14 +20,13 @@ jobs: shell: bash -l {0} steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup environment - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: python-version: "3.9" - miniforge-variant: Mambaforge - channels: conda-forge,defaults + channels: conda-forge channel-priority: strict environment-file: envs/hydromt-delft3dfm.yml activate-environment: hydromt-delft3dfm diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 9c2e4eaa..e2aee672 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v3 - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 89df2f44..e65d1505 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: build-artifacts: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 From 533d58c2119f321c0918a7a3c8897c26a64b068e Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Wed, 16 Oct 2024 07:08:47 +0200 Subject: [PATCH 2/2] Align dflowfm buildyml (#178) * aligned dflowfm_build.yml while keeping all tests pass (follow up issues #177 and #181) * added missing build steps in test_model_build_local_code * added link to issue in comment --- tests/data/dflowfm_build.yml | 18 ++++++++++++++++-- tests/data/dflowfm_build_local.yml | 7 +++++++ tests/test_hydromt.py | 2 ++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/tests/data/dflowfm_build.yml b/tests/data/dflowfm_build.yml index 36190b64..4d6723a9 100644 --- a/tests/data/dflowfm_build.yml +++ b/tests/data/dflowfm_build.yml @@ -1,8 +1,16 @@ +#global: +# crs: 3857 +# network_snap_offset: 25 +# openwater_computation_node_distance: 40 +# commented, because not supported with the current test method +# https://github.com/Deltares/hydromt_delft3dfm/issues/181 + setup_rivers_from_dem: region: bbox: [12.4331, 46.4661, 12.5212, 46.5369] hydrography_fn: merit_hydro river_geom_fn: hydro_rivers_lin + rivers_defaults_fn: rivers_defaults rivdph_method: gvf rivwth_method: geom river_upa: 25.0 @@ -14,6 +22,7 @@ setup_pipes: region: bbox: [12.4331, 46.4661, 12.5212, 46.5369] pipes_fn: grip_roads + pipes_defaults_fn: pipes_defaults pipe_filter: pipe spacing: 50 friction_type: WhiteColeBrook @@ -26,7 +35,10 @@ setup_pipes: pipes_invlev: 3. setup_manholes: + manholes_fn: + manhole_defaults_fn: manholes_defaults dem_fn: merit_hydro + bedlevel_shift: 0.5 setup_1dboundary: boundary_value: -2.0 @@ -45,14 +57,16 @@ setup_maps_from_rasterdataset: variables: ["elevtn"] fill_method: nearest interpolation_method: nearestNb - split_dataset: True setup_maps_from_raster_reclass: raster_fn: vito_2015 reclass_table_fn: vito_mapping reclass_variables: ['roughness_manning', 'infiltcap'] interpolation_method: triangulation - split_dataset: True + +#setup_rainfall_from_constant: +# constant_value: 150 +# this should probably be uncommented: https://github.com/Deltares/hydromt_delft3dfm/issues/177 setup_link1d2d: link_direction: 1d_to_2d \ No newline at end of file diff --git a/tests/data/dflowfm_build_local.yml b/tests/data/dflowfm_build_local.yml index a55a823c..287d4789 100644 --- a/tests/data/dflowfm_build_local.yml +++ b/tests/data/dflowfm_build_local.yml @@ -1,3 +1,10 @@ +#global: +# crs: 32647 +# network_snap_offset: 25 +# openwater_computation_node_distance: 40 +# commented, because not supported with the current test method +# https://github.com/Deltares/hydromt_delft3dfm/issues/181 + setup_rivers: region: geom: "local_data/1D_extent.geojson" diff --git a/tests/test_hydromt.py b/tests/test_hydromt.py index 3f0423b8..3f89fc4a 100644 --- a/tests/test_hydromt.py +++ b/tests/test_hydromt.py @@ -109,6 +109,8 @@ def test_model_build_local_code(tmp_path): model.setup_rivers(**opt['setup_rivers1']) model.setup_pipes(**opt['setup_pipes']) model.setup_manholes(**opt['setup_manholes']) + model.setup_bridges(**opt['setup_bridges']) + model.setup_culverts(**opt['setup_culverts']) model.setup_1dboundary(**opt['setup_1dboundary']) model.setup_1dlateral_from_points(**opt['setup_1dlateral_from_points']) model.setup_1dlateral_from_polygons(**opt['setup_1dlateral_from_polygons'])